@ngrx/store#compose TypeScript Examples
The following examples show how to use
@ngrx/store#compose.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: index.ts From digital-bank-ui with Mozilla Public License 2.0 | 6 votes |
export function createReducer(asyncReducers = {}): ActionReducer<any> {
const actionReducer = compose(
localStorageSync({
keys: [],
rehydrate: true,
}),
combineReducers,
)(Object.assign(reducers, asyncReducers));
return function(state: any, action: any) {
// Reset state
if (action.type === authenticationActions.LOGOUT_SUCCESS) {
return actionReducer(undefined, action);
}
return actionReducer(state, action);
};
}