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:
parent
e24ea4afeb
commit
2b7b756212
26 changed files with 242 additions and 369 deletions
|
@ -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
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