File tree Expand file tree Collapse file tree 2 files changed +48
-0
lines changed
packages/overmind-website Expand file tree Collapse file tree 2 files changed +48
-0
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,13 @@ You are only allowed to change the state in the mutate operator.
5656h(Example, { name: "api/operators_operator_mutate" })
5757```
5858
59+ ## parallel
60+ Will run every operator and wait for all of them to finish before moving on. Works like * Promise.all* .
61+
62+ ``` marksy
63+ h(Example, { name: "api/operators_operator_parallel" })
64+ ```
65+
5966## pipe
6067The pipe is an operator in itself. Use it to compose other operators and pipes.
6168
Original file line number Diff line number Diff line change 1+ export default ( ts ) =>
2+ ts
3+ ? [
4+ {
5+ code : `
6+ import { Operator, pipe, mutate } from 'overmind'
7+ import { Item } from './state'
8+
9+ export const loadSomeData: Operator<void, void> = pipe(...)
10+ export const loadSomeMoreData: Operator<void, void> = pipe(...)
11+ export const manageAllData = mutate(...)
12+
13+ export const openItem: Operator<void, void> = pipe(
14+ parallel([
15+ loadSomeData,
16+ loadSomeMoreData
17+ ]),
18+ manageAllData
19+ )
20+ ` ,
21+ } ,
22+ ]
23+ : [
24+ {
25+ code : `
26+ import { pipe, mutate } from 'overmind'
27+
28+ export const loadSomeData = pipe(...)
29+ export const loadSomeMoreData = pipe(...)
30+ export const manageAllData = mutate(...)
31+
32+ export const openItem = pipe(
33+ parallel([
34+ loadSomeData,
35+ loadSomeMoreData
36+ ]),
37+ manageAllData
38+ )
39+ ` ,
40+ } ,
41+ ]
You can’t perform that action at this time.
0 commit comments