updated leaflet version and tree-shaked deps

This commit is contained in:
Fedor Katurov 2020-01-16 17:08:55 +07:00
parent 973f934614
commit d8d448bcf7
7 changed files with 22 additions and 10 deletions

13
src/utils/reducer.ts Normal file
View file

@ -0,0 +1,13 @@
// create-reducer.ts
import { Action } from 'redux';
type Handlers<State, Types extends string, Actions extends Action<Types>> = {
readonly [Type in Types]: (state: State, action: Actions) => State
}
export const createReducer = (
initialState,
handlers,
) => (state = initialState, action) => (handlers.hasOwnProperty(action.type)
? handlers[action.type](state, action)
: state);