@livelike/react-native
Version:
LiveLike React Native package
18 lines (15 loc) • 546 B
text/typescript
import { INumberPredictionItemOption } from '@livelike/javascript';
import { numberPredictionWidgetStore } from '../store';
import { useSelectedFieldStore } from './useSelectedFieldStore';
export type UseUserNumberOptionsArg = {
widgetId: string;
};
export function useUserNumberOptions({
widgetId,
}: UseUserNumberOptionsArg): INumberPredictionItemOption[] {
const numberOptions = useSelectedFieldStore(
numberPredictionWidgetStore,
() => numberPredictionWidgetStore.get()[widgetId]?.numberOptions
);
return numberOptions;
}