Skip to content

Commit

Permalink
chore: add TypeScript test for fow
Browse files Browse the repository at this point in the history
  • Loading branch information
Michel Weststrate committed Oct 15, 2024
1 parent 3edfe4a commit 7f10f7a
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion packages/mobx/__tests__/v5/base/typescript-decorators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ import {
IAtom,
createAtom,
runInAction,
makeObservable
makeObservable,
flow,
flowResult
} from "../../../src/mobx"
import * as mobx from "../../../src/mobx"

Expand Down Expand Up @@ -61,6 +63,16 @@ test("decorators", () => {
constructor() {
makeObservable(this)
}

@flow
*testDouble(n: number): Generator<number, number> {
yield 3
return n * 2
}

async run() {
const x: number = await flowResult(this.testDouble(2))
}
}

const o = new Order()
Expand Down

0 comments on commit 7f10f7a

Please sign in to comment.