1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 04:46:40 +07:00

added register_socials to reducer

This commit is contained in:
Fedor Katurov 2020-08-20 10:55:14 +07:00
parent 358b197c19
commit 837b4ee6f3
8 changed files with 1471 additions and 1412 deletions

View file

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