mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
21 lines
468 B
TypeScript
21 lines
468 B
TypeScript
import { createReducer } from '~/utils/reducer';
|
|
import { INode, IError } from '../types';
|
|
import { FLOW_HANDLERS } from './handlers';
|
|
|
|
export type IFlowState = Readonly<{
|
|
is_loading: boolean;
|
|
nodes: INode[];
|
|
heroes: Partial<INode>[];
|
|
recent: Partial<INode>[];
|
|
error: IError;
|
|
}>;
|
|
|
|
const INITIAL_STATE: IFlowState = {
|
|
nodes: [],
|
|
heroes: [],
|
|
recent: [],
|
|
is_loading: false,
|
|
error: null,
|
|
};
|
|
|
|
export default createReducer(INITIAL_STATE, FLOW_HANDLERS);
|