Skip to content

Commit 08656f4

Browse files
docs(website): improve docs on run and some typing
1 parent 6ba7810 commit 08656f4

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

packages/overmind-website/api/pipe.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ The pipe is an operator in itself. Use it to compose other operators and pipes.
5757
h(Example, { name: "api/pipe_pipe" })
5858
```
5959

60+
## run
61+
This operator is useful to run effects. It will just pass the current value a long.
62+
63+
```marksy
64+
h(Example, { name: "api/pipe_run" })
65+
```
66+
6067
## wait
6168
Hold execution for set time.
6269

packages/overmind-website/examples/api/pipe_map.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ export default (ts) =>
44
{
55
code: `
66
import { map } from 'overmind'
7+
import { User } from './state'
78
8-
export const getUser = map(({ api }) => api.getUser())
9+
export const getUser = map<string, User>(({ api }) => api.getUser())
910
`,
1011
},
1112
]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
export default (ts) =>
2+
ts
3+
? [
4+
{
5+
code: `
6+
import { run } from 'overmind'
7+
8+
export const doSomething = run<string>(({ someEffect }) => someEffect.run())
9+
`,
10+
},
11+
]
12+
: [
13+
{
14+
code: `
15+
import { run } from 'overmind'
16+
17+
export const doSomething = run(({ someEffect }) => someEffect.run())
18+
`,
19+
},
20+
]

0 commit comments

Comments
 (0)