Skip to content

Commit

Permalink
Use babel-decorators
Browse files Browse the repository at this point in the history
  • Loading branch information
mweststrate committed Nov 1, 2023
1 parent ed1f6dc commit 4999d22
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
10 changes: 10 additions & 0 deletions babel.config.json
@@ -0,0 +1,10 @@
{
"plugins": [
[
"@babel/plugin-proposal-decorators",
{
"version": "2023-05"
}
]
]
}
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -7,6 +7,7 @@
"build": "parcel build public/index.html"
},
"dependencies": {
"@babel/plugin-proposal-decorators": "^7.23.2",
"immer": "^7.0.8",
"mobx": "6.11.0-pre",
"mobx-react-lite": "3.0.0-beta.1",
Expand Down
22 changes: 10 additions & 12 deletions src/orders.ts → src/orders.js
@@ -1,8 +1,6 @@
import { uuidv4 } from "./utils"
import { observable, makeAutoObservable, action, computed } from "mobx"

type Currencies = { [key: string]: number }

export function getInitialCurrencies() {
return observable({
eur: 1.12,
Expand Down Expand Up @@ -42,17 +40,17 @@ function getInitialOrders() {
]
}
class Order {
readonly id: string
@observable accessor title: string = "";
@observable accessor price: number = 0;
@observable accessor currency: string;
readonly currencies: Currencies;
id
@observable accessor title = "";
@observable accessor price = 0;
@observable accessor currency;
currencies;

constructor(id: string,
title: string,
price: number,
currency: string,
currencies: Currencies) {
constructor(id,
title,
price,
currency,
currencies) {
this.id = id
this.title = title;
this.price = price;
Expand Down

0 comments on commit 4999d22

Please sign in to comment.