mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
added register_socials to reducer
This commit is contained in:
parent
358b197c19
commit
837b4ee6f3
8 changed files with 1471 additions and 1412 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue