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:
parent
8f9c61e1f6
commit
0666237586
7 changed files with 111 additions and 126 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue