Files
twenty/packages/twenty-front/src/modules/ui/utilities/recoil-scope/utils/createStateScopeMap.ts
Charles Bochet 96264e264c Refactor recoil v4 (#3266)
* Refactor recoil v4

* Fix ci
2024-01-05 19:18:22 +01:00

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,
});
};