17 lines
365 B
TypeScript
17 lines
365 B
TypeScript
import { atomFamily } from 'recoil';
|
|
|
|
import { StateScopeMapKey } from '@/ui/utilities/recoil-scope/scopes-internal/types/StateScopeMapKey';
|
|
|
|
export const createStateScopeMap = <ValueType>({
|
|
key,
|
|
defaultValue,
|
|
}: {
|
|
key: string;
|
|
defaultValue: ValueType;
|
|
}) => {
|
|
return atomFamily<ValueType, StateScopeMapKey>({
|
|
key,
|
|
default: defaultValue,
|
|
});
|
|
};
|