diff --git a/docs/actions.md b/docs/actions.md index d627f31a0..3b277a8ec 100644 --- a/docs/actions.md +++ b/docs/actions.md @@ -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"