mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 11:06:40 +07:00
updated leaflet version and tree-shaked deps
This commit is contained in:
parent
973f934614
commit
d8d448bcf7
7 changed files with 22 additions and 10 deletions
13
src/utils/reducer.ts
Normal file
13
src/utils/reducer.ts
Normal 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);
|
Loading…
Add table
Add a link
Reference in a new issue