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

getting node results for search

This commit is contained in:
Fedor Katurov 2020-04-18 16:06:10 +07:00
parent 41a35f1490
commit 94ac596b92
15 changed files with 308 additions and 164 deletions

View file

@ -1,6 +1,6 @@
import { createReducer } from "~/utils/reducer";
import { INode, IError } from "../types";
import { FLOW_HANDLERS } from "./handlers";
import { createReducer } from '~/utils/reducer';
import { INode, IError } from '../types';
import { FLOW_HANDLERS } from './handlers';
export type IFlowState = Readonly<{
is_loading: boolean;
@ -8,7 +8,11 @@ export type IFlowState = Readonly<{
heroes: Partial<INode>[];
recent: Partial<INode>[];
updated: Partial<INode>[];
range: [string, string];
search: {
text: string;
is_loading: boolean;
results: INode[];
};
error: IError;
}>;
@ -17,9 +21,13 @@ const INITIAL_STATE: IFlowState = {
heroes: [],
recent: [],
updated: [],
range: [null, null], // drop it, we use realtime range calc
search: {
text: '',
is_loading: false,
results: [],
},
is_loading: false,
error: null
error: null,
};
export default createReducer(INITIAL_STATE, FLOW_HANDLERS);