-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathtypes.js
56 lines (39 loc) · 1.83 KB
/
types.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//@flow
export const firebase = {
FIREBASE_UPDATE_REQUESTED: 'FIREBASE_UPDATE_REQUESTED',
FIREBASE_UPDATE_FULFILLED: 'FIREBASE_UPDATE_FULFILLED',
FIREBASE_UPDATE_REJECTED: 'FIREBASE_UPDATE_REJECTED',
FIREBASE_REMOVE_REQUESTED: 'FIREBASE_REMOVE_REQUESTED',
FIREBASE_REMOVE_FULFILLED: 'FIREBASE_REMOVE_FULFILLED',
FIREBASE_REMOVE_REJECTED: 'FIREBASE_REMOVE_REJECTED',
FIREBASE_LISTEN_REQUESTED: 'FIREBASE_LISTEN_REQUESTED',
FIREBASE_LISTEN_FULFILLED: 'FIREBASE_LISTEN_FULFILLED',
FIREBASE_LISTEN_REJECTED: 'FIREBASE_LISTEN_REJECTED',
FIREBASE_LISTEN_CHILD_ADDED: 'FIREBASE_LISTEN_CHILD_ADDED',
FIREBASE_LISTEN_CHILD_CHANGED: 'FIREBASE_LISTEN_CHILD_CHANGED',
FIREBASE_LISTEN_CHILD_REMOVED: 'FIREBASE_LISTEN_CHILD_REMOVED',
FIREBASE_LISTEN_REMOVED: 'FIREBASE_LISTEN_REMOVED',
FIREBASE_RESET_DATA: 'FIREBASE_RESET_DATA'
}
export const metaTypes = {
messages: 'messages',
userContacts: 'userContacts',
updateMessage: 'updateMessage',
removeMessage: 'removeMessage',
}
export type MetaType = $Keys<typeof metaTypes>
export type EmptyAction = {
type: string,
}
export type MetaAction = EmptyAction & { metaType: MetaType }
export type MetaActionWithError = MetaAction & { error: string }
export type MetaActionWithItems = MetaAction & { items: Object }
export type MetaActionWithRef = MetaAction & { ref: Object }
export type MetaActionWithId = MetaAction & { id: string }
export type MetaActionWithChild = MetaActionWithId & { value: Object }
export type MetaActionWithClear = MetaAction & { clearItems: boolean }
export type UpdateItemsActions = MetaAction | MetaActionWithError
export type RemoveItemActions = MetaAction | MetaActionWithError
export type ListenToPathActions = MetaAction | MetaActionWithRef |
MetaActionWithChild | MetaActionWithId | MetaActionWithError |
MetaActionWithItems | MetaActionWithClear