Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(javascript): inline property decorator should stay inline (#5364)
Fixes the `@action` part in #5360
- Loading branch information
Showing
3 changed files
with
76 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,32 @@ | ||
import {observable} from "mobx"; | ||
|
||
@observer class OrderLine { | ||
@observable price:number = 0; | ||
@observable amount:number = 1; | ||
|
||
constructor(price) { | ||
this.price = price; | ||
} | ||
|
||
@computed get total() { | ||
return this.price * this.amount; | ||
} | ||
|
||
@action.bound setPrice(price) { | ||
this.price = price; | ||
} | ||
} | ||
import {observable} from "mobx"; | ||
|
||
@observer class OrderLine { | ||
@observable price:number = 0; | ||
@observable amount:number = 1; | ||
|
||
constructor(price) { | ||
this.price = price; | ||
} | ||
|
||
@computed get total() { | ||
return this.price * this.amount; | ||
} | ||
|
||
@action.bound setPrice(price) { | ||
this.price = price; | ||
} | ||
|
||
@computed | ||
get total() { | ||
return this.price * this.amount; | ||
} | ||
|
||
@action.bound | ||
setPrice(price) { | ||
this.price = price; | ||
} | ||
|
||
@computed @computed @computed @computed @computed @computed @computed get total() { | ||
return this.price * this.amount; | ||
} | ||
} |