mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-26 05:16:41 +07:00
removed lab reducer
This commit is contained in:
parent
e24ea4afeb
commit
2b7b756212
26 changed files with 242 additions and 369 deletions
22
src/store/lab/LabStore.ts
Normal file
22
src/store/lab/LabStore.ts
Normal file
|
@ -0,0 +1,22 @@
|
|||
import { makeAutoObservable } from 'mobx';
|
||||
import { IFlowNode, ITag } from '~/redux/types';
|
||||
import { ILabNode } from '~/types/lab';
|
||||
|
||||
export class LabStore {
|
||||
// actual nodes
|
||||
nodes: ILabNode[] = [];
|
||||
|
||||
// stats
|
||||
heroes: IFlowNode[] = [];
|
||||
tags: ITag[] = [];
|
||||
updates: IFlowNode[] = [];
|
||||
|
||||
constructor() {
|
||||
makeAutoObservable(this);
|
||||
}
|
||||
|
||||
setNodes = (nodes: ILabNode[]) => (this.nodes = nodes);
|
||||
setHeroes = (heroes: IFlowNode[]) => (this.heroes = heroes);
|
||||
setTags = (tags: ITag[]) => (this.tags = tags);
|
||||
setUpdates = (updates: IFlowNode[]) => (this.updates = updates);
|
||||
}
|
3
src/store/lab/useLabStore.ts
Normal file
3
src/store/lab/useLabStore.ts
Normal file
|
@ -0,0 +1,3 @@
|
|||
import { useStore } from '~/utils/context/StoreContextProvider';
|
||||
|
||||
export const useLabStore = () => useStore().lab;
|
Loading…
Add table
Add a link
Reference in a new issue