-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathredux-actions.redux.txt
22 lines (18 loc) · 1.29 KB
/
redux-actions.redux.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
┏━━━━━━━━━━━━━━━━━━━┓
┃ REDUX-ACTIONS ┃
┗━━━━━━━━━━━━━━━━━━━┛
VERSION ==> #0.9.0
#Utilities for creating and handling FSA
REDUXACTIONS.createAction #Returns FUNC3(VAL, ...)->ACTION:
('TYPE'[, FUNC][, FUNC2]) # - type 'TYPE'
# - payload VAL or (if specified) FUNC(VAL, ...)
# - meta FUNC2(VAL, ...) (if specified)
# - error true: if VAL is ERROR
REDUXACTIONS.handleAction
('TYPE', RFUNC) #Wraps reducer RFUNC so that it only handles ACTION if ACTION.type 'TYPE'
REDUXACTIONS.handleAction
('TYPE', { next|throw RFUNC }) #Same but fire next|throw according to ACTION.error BOOL
REDUXACTIONS.handleActions #Does:
({ 'TYPE': VAL, ... }[, APPSTATE])# - creates one RFUNC for each REDUXACTIONS.handleAction('TYPE', VAL)
# - combines/returns them in a single RFUNC2 (called after another in unspecified order)
# - if APPSTATE, is default initial APPSTATE