UNPKG

720 BJavaScriptView Raw
1import { BEGIN_REQUEST, COMPLETE_REQUEST, FAIL_REQUEST } from '../constants'
2import { BEGIN, COMMIT, REVERT } from 'optimistic-redux'
3
4export type Action = {
5 type: string,
6 payload: ?any
7}
8
9export type ServerAction = {
10 meta: Object & {
11 optimistic: ?boolean,
12 requestName: ?string
13 }
14}
15
16export 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
29export type OptimisticAction = {
30 optimist: ?{type: BEGIN | COMMIT | REVERT, id: string}
31}
\No newline at end of file