forked from Automattic/liveblog
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapiActions.js
executable file
·99 lines (79 loc) · 1.85 KB
/
apiActions.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import types from './actionTypes';
export const getEntries = (page, hash = false) => ({
type: types.GET_ENTRIES,
page,
hash,
});
export const getEntriesPaginated = (page, scrollTo) => ({
type: types.GET_ENTRIES_PAGINATED,
page,
scrollTo,
});
export const getEntriesSuccess = (payload, renderNewEntries) => ({
type: types.GET_ENTRIES_SUCCESS,
payload,
renderNewEntries,
});
export const getEntriesFailed = () => ({
type: types.GET_ENTRIES_FAILED,
error: true,
});
export const startPolling = payload => ({
type: types.START_POLLING,
payload,
});
export const pollingSuccess = (payload, renderNewEntries) => ({
type: types.POLLING_SUCCESS,
payload,
renderNewEntries,
});
export const pollingFailed = () => ({
type: types.POLLING_FAILED,
error: true,
});
export const cancelPolling = () => ({
type: types.CANCEL_POLLING,
});
export const createEntry = payload => ({
type: types.CREATE_ENTRY,
payload,
});
export const createEntrySuccess = payload => ({
type: types.CREATE_ENTRY_SUCCESS,
payload,
});
export const createEntryFailed = () => ({
type: types.CREATE_ENTRY_FAILED,
error: true,
});
export const deleteEntry = payload => ({
type: types.DELETE_ENTRY,
payload,
});
export const deleteEntrySuccess = payload => ({
type: types.DELETE_ENTRY_SUCCESS,
payload,
});
export const deleteEntryFailed = () => ({
type: types.DELETE_ENTRY_FAILED,
error: true,
});
export const updateEntry = payload => ({
type: types.UPDATE_ENTRY,
payload,
});
export const updateEntrySuccess = payload => ({
type: types.UPDATE_ENTRY_SUCCESS,
payload,
});
export const updateEntryFailed = () => ({
type: types.UPDATE_ENTRY_FAILED,
error: true,
});
export const mergePolling = () => ({
type: types.MERGE_POLLING,
});
export const mergePollingIntoEntries = payload => ({
type: types.MERGE_POLLING_INTO_ENTRIES,
payload,
});