Methods
(inner) getMiddlewares(middleware) → {array}
return the array of all middleware needed for CMF to run
Parameters:
Name | Type | Description |
---|---|---|
middleware |
array | function |
Returns:
of middlewares
- Type
- array
(inner) getReducer(appReducer) → {function}
Return the CMF reducer
Parameters:
Name | Type | Description |
---|---|---|
appReducer |
function | Object | [description] |
Returns:
[description]
- Type
- function
(inner) initialize(appReducer, preloadedState, enhancer, middleware) → {Object}
helper to create the store with all the things needed by CMF
the store look like this:
- root
|- app (with appReducer)
|- cmf (for the internals)
Parameters:
Name | Type | Description |
---|---|---|
appReducer |
function | the reducer for your app. |
preloadedState |
any | if you want to create your state tree with initial values. This is usefull for server side renderring |
enhancer |
function | The store enhancer |
middleware |
Array | function | redux middleware: http://redux.js.org/docs/api/applyMiddleware.html |
Returns:
The created store
- Type
- Object
(inner) setHttpMiddleware(middleware)
setHttpMiddleware overwrites the default http middleware
httpMiddleware NEED to be executed before cmfMiddleware
Parameters:
Name | Type | Description |
---|---|---|
middleware |
a http middleware |
Type Definitions
Store
Type:
- Object