@@ -9,19 +9,18 @@ const mapKeys = (o, f) => {
99} ;
1010
1111const createSimpleReduxModule = ( storeKey , initialState ) => {
12- const UPDATE_ACTION = `${ storeKey } -update` ;
1312 const [ hook , dispatchers , virtualStore ] = createReduxModule ( storeKey , initialState , {
14- [ UPDATE_ACTION ] : ( state , payload ) => payload
13+ update : ( state , payload ) => payload
1514 } ) ;
16- return [ hook , dispatchers [ UPDATE_ACTION ] , virtualStore ] ;
15+ return [ hook , dispatchers . update , virtualStore ] ;
1716} ;
1817
1918const createReduxModule = ( storeKey , initialState , reducers , store = getStore ( ) ) => {
2019 if ( ! reducers ) return createSimpleReduxModule ( storeKey , initialState ) ;
2120
2221 let getQualifiedActionType = ( type ) => `${ storeKey } -${ type } ` ;
2322 let qualifiedReducers = { }
24- Object . keys ( reducers ) . map ( key => { return qualifiedReducers [ getQualifiedActionType ( key ) ] = reducers [ key ] } ) ;
23+ Object . keys ( reducers ) . map ( key => { return qualifiedReducers [ getQualifiedActionType ( key ) ] = reducers [ key ] } ) ;
2524
2625 store . injectReducer ( storeKey , ( state = initialState , { type, payload } ) =>
2726 qualifiedReducers [ type ] ? qualifiedReducers [ type ] ( state , payload ) : state
0 commit comments