Commit 2abf0554 authored by Ryan Diehl's avatar Ryan Diehl

refactor: removes createReducer

parent 2b0e0ceb
Pipeline #101027 failed with stages
in 3 minutes and 52 seconds
export { httpRetryBackoff, HttpRetryBackoffConfig } from './lib/http-backoff';
export { createReducer } from './lib/reducer-utils';
import { createReducer } from '..';
describe('reducer utils', () => {
describe('createReducer', () => {
it('should create reducer correctly', () => {
const result = createReducer({}, {});
expect(result instanceof Function).toBe(true);
expect(result({ s: 's' }, {})).toEqual({ s: 's' });
});
});
});
/**
* @deprecated use ngrx reducer creators instead
*
*/
export function createReducer(iState, handlers): (state, action) => any {
return (state = iState, action) => {
return handlers.hasOwnProperty(action.type) ? handlers[action.type](state, action) : state;
};
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment