spacedrive/interface/hooks/useSpacedropState.ts
Oscar Beaumont 3c440783b3
Spacedrop (#761)
* A hint of file drop

* backport from #671

* accept/reject Spacedrop working

* final cleanup

* Rename spacedrop.tsx to Spacedrop.tsx

* Update index.tsx
2023-04-27 04:41:33 +00:00

12 lines
314 B
TypeScript

import { proxy, subscribe, useSnapshot } from 'valtio';
const state = proxy({
droppedFiles: [] as string[]
});
export const useSpacedropState = () => useSnapshot(state);
export const getSpacedropState = () => state;
export const subscribeSpacedropState = (callback: () => void) => subscribe(state, callback);