mirror of
https://github.com/massbug/judge4c.git
synced 2025-05-17 23:12:23 +00:00
feat(dockview): add Zustand store for dockview API management
This commit is contained in:
parent
faf7f45425
commit
69e06ecfc6
17
src/stores/dockview.ts
Normal file
17
src/stores/dockview.ts
Normal file
@ -0,0 +1,17 @@
|
||||
import { create } from "zustand";
|
||||
import type { DockviewApi } from "dockview";
|
||||
|
||||
export type DockviewState = {
|
||||
api: DockviewApi | null;
|
||||
};
|
||||
|
||||
export type DockviewActions = {
|
||||
setApi: (api: DockviewApi) => void;
|
||||
};
|
||||
|
||||
export type DockviewStore = DockviewState & DockviewActions;
|
||||
|
||||
export const useDockviewStore = create<DockviewStore>()((set) => ({
|
||||
api: null,
|
||||
setApi: (api) => set({ api }),
|
||||
}));
|
Loading…
Reference in New Issue
Block a user