Skip to content

Commit

Permalink
Update actions.md (#3642)
Browse files Browse the repository at this point in the history
Get rid of unnecessary arguments in the constructor functions.
OR we can use those "value" arguments to initiate the value variables.
  • Loading branch information
shum-dev committed Mar 4, 2023
1 parent faf075c commit c40e0bd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import { makeObservable, observable, action } from "mobx"
class Doubler {
value = 0

constructor(value) {
constructor() {
makeObservable(this, {
value: observable,
increment: action
Expand All @@ -58,7 +58,7 @@ import { makeAutoObservable } from "mobx"
class Doubler {
value = 0

constructor(value) {
constructor() {
makeAutoObservable(this)
}

Expand All @@ -77,7 +77,7 @@ import { makeObservable, observable, action } from "mobx"
class Doubler {
value = 0

constructor(value) {
constructor() {
makeObservable(this, {
value: observable,
increment: action.bound
Expand Down Expand Up @@ -175,7 +175,7 @@ import { makeAutoObservable } from "mobx"
class Doubler {
value = 0

constructor(value) {
constructor() {
makeAutoObservable(this, {}, { autoBind: true })
}

Expand Down

0 comments on commit c40e0bd

Please sign in to comment.