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

added markdown formatter

This commit is contained in:
Fedor Katurov 2021-02-24 14:18:59 +07:00
parent 8f9c61e1f6
commit 0666237586
7 changed files with 111 additions and 126 deletions

View file

@ -5,11 +5,5 @@ type Handlers<State, Types extends string, Actions extends Action<Types>> = {
readonly [Type in Types]: (state: State, action: Actions) => State;
};
// export const createReducer = <State, Types extends string, Actions extends Action<Types>>(
// initialState: State,
// handlers: Handlers<State, Types, Actions>,
// ) => (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;