forked from jeffbski/redux-logic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
actions.js
37 lines (31 loc) · 1.13 KB
/
actions.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
import shortid from 'shortid';
// unique key namespace used by combineReducers.
// By convention it will match the directory structure to
// make it easy to locate the src.
// Also action types will prefix with the capitalized version
export const key = 'notify';
// action type constants
export const NOTIFY_CREATE = 'NOTIFY_CREATE';
export const NOTIFY_QUEUE = 'NOTIFY_QUEUE';
export const NOTIFY_REMOVE = 'NOTIFY_REMOVE';
export const NOTIFY_DISPLAY_QUEUED = 'NOTIFY_DISPLAY_QUEUED';
export const actionTypes = {
NOTIFY_CREATE,
NOTIFY_QUEUE,
NOTIFY_REMOVE,
NOTIFY_DISPLAY_QUEUED
};
// action creators
export const notifyCreate = () => ({ type: NOTIFY_CREATE,
payload: shortid.generate() });
export const notifyQueue = (id) => ({ type: NOTIFY_QUEUE,
payload: id });
export const notifyRemove = (arrIds) => ({ type: NOTIFY_REMOVE,
payload: arrIds });
export const notifyDisplayQueued = () => ({ type: NOTIFY_DISPLAY_QUEUED });
export const actions = {
notifyCreate,
notifyQueue,
notifyRemove,
notifyDisplayQueued
};