1 | import { BEGIN_REQUEST, COMPLETE_REQUEST, FAIL_REQUEST } from '../constants'
|
2 | import { BEGIN, COMMIT, REVERT } from 'optimistic-redux'
|
3 |
|
4 | export type Action = {
|
5 | type: string,
|
6 | payload: ?any
|
7 | }
|
8 |
|
9 | export type ServerAction = {
|
10 | meta: Object & {
|
11 | optimistic: ?boolean,
|
12 | requestName: ?string
|
13 | }
|
14 | }
|
15 |
|
16 | export type RequestAction = {
|
17 | type: string,
|
18 | meta: {
|
19 | requestId: string,
|
20 | requestName: ?string,
|
21 | status: ?(BEGIN_REQUEST | COMPLETE_REQUEST | FAIL_REQUEST),
|
22 | _metaPayload: ?Object,
|
23 | _isServerAction: boolean,
|
24 | _isOptimistic: boolean
|
25 | },
|
26 | payload: ?Object
|
27 | }
|
28 |
|
29 | export type OptimisticAction = {
|
30 | optimist: ?{type: BEGIN | COMMIT | REVERT, id: string}
|
31 | } |
\ | No newline at end of file |