mirror of
https://github.com/massbug/judge4c.git
synced 2026-10-15 15:00:14 +00:00
feat(dockview): add Zustand store for dockview API management
This commit is contained in:
@@ -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 }),
|
||||||
|
}));
|
||||||
Reference in New Issue
Block a user