Skip to content

Commit 0270e2b

Browse files
docs(website): add info about events
1 parent fadd3a9 commit 0270e2b

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

packages/overmind-website/api/createOvermind.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,25 @@ By default Overmind will do the necessary hot reloading mechanism to keep your s
3535
```marksy
3636
h(Example, { name: "api/app_options_hotreloading" })
3737
```
38+
39+
## events
40+
41+
Overmind emits events during execution of actions and similar. It can be beneficial to listen to these events for analytics or maybe you want to create a custom debugging experience. The following events can be listened to by adding a listener to the eventHub:
42+
43+
```ts
44+
overmind.eventHub.on('action:start', (execution) => {})
45+
overmind.eventHub.on('action:end', (execution) => {})
46+
overmind.eventHub.on('operator:start', (execution) => {})
47+
overmind.eventHub.on('operator:end', (execution) => {})
48+
overmind.eventHub.on('operator:async', (execution) => {})
49+
overmind.eventHub.on('mutations', (executionAndMutations) => {})
50+
overmind.eventHub.on('derived', (derived) => {})
51+
overmind.eventHub.on('derived:dirty', (derivedPathAndFlush) => {})
52+
53+
// Only during development
54+
overmind.eventHub.on('effect', (effectDetails) => {})
55+
overmind.eventHub.on('getter', (getterDetails) => {})
56+
overmind.eventHub.on('component:add', (componentDetails) => {})
57+
overmind.eventHub.on('component:update', (componentDetails) => {})
58+
overmind.eventHub.on('component:remove', (componentDetails) => {})
59+
```

0 commit comments

Comments
 (0)