Redux Atomic Action
Inspired by Haskell and Angular 2
Core Concept
{ // ... return atomicModifyStateAction;}
Install
npm install --save redux-atomic-action
Usage
;; const initialState = todos: visibleFilter: "SHOW_ALL" let store = ; store { return { let nextState = Object return nextState; }} store;
Modify State Tree
; // ... let todos = ; { let _todos; return ;} store
let initialState = dashboard: todos: ... let todos =
Action Name
{ let Object return ADD_TODO;}// action.name === "ADD_TODO"
createStateModifier
let todos = ; { let _todos; return ;}// action.name === "ADD_TODO"
name
; // *alias*: `nameFunc` { return ;}// action.name === "ADD_TODO"
atomicAction
alias:
action
store // action.name === "ADD_TODO"
// Is the same as `name(state => state, "ALARM")` store;// action.name === "ALARM"
Default Reducer
{ if "ADD_TODO" "GET_TODO" !== -1 return state; } let store = ;
Async Atomic Action
{ return api ;} getTodos;
Changelog
Visit Github Releases page for more information.