Coggle requires JavaScript to display documents.
const store = createStore( <reducer>, <preloadState> [, <setUpReduxDevtools>] )
reducer(<action>)
action = { type: <type_value>, [<other_prop>: <prop_value>] }
store.dispatch(<action>)
store.subscribe(<callback_fn>)
createStore( <rootReducer> [, <preloadState> [, <setUpReduxDevTools>] )
<Provider store={store_from_import}> <YourAppScope> </Propvider>
addNote(note) { return { type: 'ADD_NOTE' id: note.id, content: note.content, createdDate: Date.now() } }
const rootReducer = combineReducers({ <reducerProp1>: <xxxReducer> [, <reducerProp2>: <yyyReducer>] [, <reducerProp3>: <zzzReducer>] [, ...] })
const mapStateToprops = (<state>) => { <prop>: <state>.<state_property> [, <prop2>: <state>.<state_property2>] [, <prop3>: <state>.<state_property2>] ... }
this.props.<stateProps>
const mapDispatchToProps = { <prop>: <action_from_import> [, <prop2>: <action2_from_import>] [, <prop2>: <action2_from_import>] }
this.props.<propFromMapDispatchToProps>
connect( <mapStateToProps> , <mapDispatchToProps> [, <mergeProps>] [, <option>] )(<YourComponent>)
หมายเหตุ
connect()
fResult