mirror of
https://github.com/zoriya/v10.git
synced 2026-08-09 23:58:06 +00:00
9 lines
317 B
TypeScript
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];
|
|
}
|