mirror of
https://github.com/spacedriveapp/spacedrive
synced 2024-07-08 12:54:05 +00:00
* A hint of file drop * backport from #671 * accept/reject Spacedrop working * final cleanup * Rename spacedrop.tsx to Spacedrop.tsx * Update index.tsx
12 lines
314 B
TypeScript
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);
|