Skip to content

Commit

Permalink
docs: observable fields is not specified (#3930)
Browse files Browse the repository at this point in the history
  • Loading branch information
PredokMiF authored Oct 15, 2024
1 parent f91d2e1 commit 4a5373f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion docs/actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -443,12 +443,19 @@ However, TypeScript isn't aware of that transformation, so `flowResult` will mak
`flow`, like `action`, can be used to wrap functions directly. The above example could also have been written as follows:

```typescript
import { flow } from "mobx"
import { flow, makeObservable, observable } from "mobx"

class Store {
githubProjects = []
state = "pending"

constructor() {
makeObservable(this, {
githubProjects: observable,
state: observable,
})
}

fetchProjects = flow(function* (this: Store) {
this.githubProjects = []
this.state = "pending"
Expand Down

0 comments on commit 4a5373f

Please sign in to comment.