flow / src /store /useCursorStore.ts
mrfakename's picture
Initial Flow app
fb57ab3 verified
Raw History Blame Contribute Delete
347 Bytes
import { create } from "zustand";
interface CursorState {
x: number;
y: number;
zoom: number;
set: (p: Partial<CursorState>) => void;
}
/** Kept separate from the canvas store so mouse moves never re-render the graph. */
export const useCursorStore = create<CursorState>((set) => ({
x: 0,
y: 0,
zoom: 1,
set: (p) => set(p),
}));