Files
v10/packages/sandbox/app/utils/use-source-switcher.ts
T
2026-03-11 14:02:12 +11:00

9 lines
317 B
TypeScript

import type { SourceId } from '@app/shared/sources';
import { sourceStore } from './stores';
import { useExternalStore } from './use-external-store';
export function useSourceSwitcher(): [SourceId, (value: SourceId) => void] {
const value = useExternalStore(sourceStore);
return [value, sourceStore.setValue];
}