@leaddreamer/enhancedredux v0.1.0
@SaltSweetSpirits/ESBrowser
An Enhanced Redux store, with defered subscribe/unsubscribe functionality
Modules
ConfigureStore
Customzied Redux Store and support - legacy naming
- ConfigureStore
- static
- .store : ReduxStore
- inner
- static
ConfigureStore.store : ReduxStore
Kind: static constant of ConfigureStore
ConfigureStore~asyncReducers : object
Initializes a dictionary to keep track of the registered async reducers
Kind: inner property of ConfigureStore
ConfigureStore~listeners : object
Initializes a dictionary to keep track of registered defered inits
Kind: inner property of ConfigureStore
ConfigureStore~injectReducer(key, asyncReducer)
Kind: inner method of ConfigureStore
Param | Type | Description |
---|---|---|
key | string | unique key/name |
asyncReducer | callback |
ConfigureStore~injectListener(key, listener, deleteOnSub)
Kind: inner method of ConfigureStore
Param | Type | Description |
---|---|---|
key | string | unique string to identify this listener |
listener | function | function that establishes a database listener; expects function to return an unsubscribe function. |
deleteOnSub | boolean | flag to indicate whether to delete the listener altogether when unsubscribed (removes from defers) |
ConfigureStore~runListener(key)
Runs a specific listener by Key
Kind: inner method of ConfigureStore
Param | Type | Description |
---|---|---|
key | string | unique string to identify which listener to start expects the listener to return an unsubscribe function to be saved |
ConfigureStore~deferred()
Runs all defered listeners
Kind: inner method of ConfigureStore
ConfigureStore~unsubscribeListeners()
Calls all listener's unsubscribe functions
Kind: inner method of ConfigureStore
ConfigureStore~createReducer(asyncReducers)
takes an array of reducers (possibly async) and returns a single reducer structure
Kind: inner method of ConfigureStore
Param | Type |
---|---|
asyncReducers | Array.callback |
ConfigureStore~ReduxStore : object
Kind: inner typedef of ConfigureStore
EnhancedRedux
A cross-project Redux store configuration
BoilerplateRedux
Generic Redux functions and constants
- BoilerplateRedux
- static
- .BROWSINGDATE
- .genericReduxAction(sliceName, specific, payload) ⇒ ActionItem
- .setGeneric(sliceName, specific, payload) ⇒ ActionItem
- .reducerGenerator(sliceName, initialState) ⇒ ReduxSliceReducer
- .selectGeneric(state, sliceName, which)
- .getGeneric(sliceName, which)
- .firstSplit(target, searchvalue) ⇒ Array.string
- inner
- ~ActionItem : object
- static
BoilerplateRedux.BROWSINGDATE
Kind: static constant of BoilerplateRedux
BoilerplateRedux.genericReduxAction(sliceName, specific, payload) ⇒ ActionItem
Creates and returns an ActionItem based on the "slice" name, specific action type, and payload
Kind: static method of BoilerplateRedux
Param | Type | Description |
---|---|---|
sliceName | string | |
specific | string | action type |
payload | object |
BoilerplateRedux.setGeneric(sliceName, specific, payload) ⇒ ActionItem
Creates and dispatches an ActionItem based on the "slice" name, specific action type, and payload
Kind: static method of BoilerplateRedux
Param | Type | Description |
---|---|---|
sliceName | string | |
specific | string | action type |
payload | object |
BoilerplateRedux.reducerGenerator(sliceName, initialState) ⇒ ReduxSliceReducer
Generic Reducer Generator
Kind: static method of BoilerplateRedux
Param | Type | Description |
---|---|---|
sliceName | string | name for this redux section |
initialState | object | specific state to initialize this slice to |
BoilerplateRedux.selectGeneric(state, sliceName, which)
gets Redux information by "slice" (really, which reducer) and "which" (table name) Synchronous to state changes
Kind: static method of BoilerplateRedux
Param | Type | Description |
---|---|---|
state | ReduxState | Redux state/store |
sliceName | string | a name to identify the reducer/state segment |
which | string | the name of the sub-table ("specific type") |
BoilerplateRedux.getGeneric(sliceName, which)
gets Redux information by "slice" (really, which reducer) and "which" (table name) Asynchronous to state changes
Kind: static method of BoilerplateRedux
Param | Type | Description |
---|---|---|
sliceName | string | a name to identify the reducer/state segment |
which | string | the name of the sub-table ("specific type") |
BoilerplateRedux.firstSplit(target, searchvalue) ⇒ Array.string
Function to split a string at the FIRST instance of a character
Kind: static method of BoilerplateRedux
Returns: Array.string - - a 2-entry array - the string BEFORE the FIRST searchValue,
and the rest of the string AFTER the search Value
Param | Type | Description |
---|---|---|
target | string | string to be split |
searchvalue | string | value to use for the split |
BoilerplateRedux~ActionItem : object
Kind: inner typedef of BoilerplateRedux
Properties
Name | Type |
---|---|
type | string |
payload | object |
monitorReducers
monitorReducers~monitorReducerEnhancer(createStore) ⇒ ReduxStore
Kind: inner method of monitorReducers
Param | Type |
---|---|
createStore | callback |
middlewareLogger
middlewareLogger~logger()
chained
Kind: inner method of middlewareLogger
RootReducer
module.exports(state, action) ⇒ ReduxState ⏏
Kind: Exported function
Param | Type |
---|---|
state | ReduxState |
action | actionType |
© 2020-2023 Tracy Hall
3 months ago
3 months ago
3 months ago
4 months ago
5 months ago