Skip to content

Commit 29b6fc8

Browse files
christianalfonigitbook-bot
authored andcommitted
GitBook: [v28] one page modified
1 parent ad7c2d4 commit 29b6fc8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

core/typescript.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ Read the guide on [**Using state machines**](../guides-1/using-state-machines.md
141141
You type your actions with the **Context** and an optional value. Any return type will be inferred.
142142

143143
```typescript
144+
import { Overmind } from 'overmind'
144145
import { Context } from 'app/overmind'
145146

146147
export const noArgAction = (context: Context) => {
@@ -160,6 +161,11 @@ export const argWithReturnTypeAction = (context: Context, value: string) => {
160161
// actions.argWithReturnTypeAction("foo"), requires "string" and returns "string"
161162
return value + '!!!'
162163
}
164+
165+
// The onInitialize action
166+
export const onInitializeOvermind = (context: Context, instance: Overmind<Context>) => {
167+
168+
}
163169
```
164170

165171
Any of these actions could be defined as an **async** function or simply return a promise to be typed that way.

0 commit comments

Comments
 (0)