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

removed lab reducer

This commit is contained in:
Fedor Katurov 2022-01-05 15:57:29 +07:00
parent e24ea4afeb
commit 2b7b756212
26 changed files with 242 additions and 369 deletions

View file

@ -2,11 +2,13 @@ import { makeAutoObservable } from 'mobx';
import { FlowStore } from '~/store/flow/FlowStore';
import { ModalStore } from '~/store/modal/ModalStore';
import { PhotoSwipeStore } from '~/store/photoSwipe/PhotoSwipeStore';
import { LabStore } from '~/store/lab/LabStore';
export class Store {
flow = new FlowStore();
modal = new ModalStore();
photoSwipe = new PhotoSwipeStore();
lab = new LabStore();
constructor() {
makeAutoObservable(this);

22
src/store/lab/LabStore.ts Normal file
View 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);
}

View file

@ -0,0 +1,3 @@
import { useStore } from '~/utils/context/StoreContextProvider';
export const useLabStore = () => useStore().lab;