* Proof of concept ComponentState * Migrate to createState and createFamilyState * Refactor * Fix * Fix tests * Fix lint * Fix tests * Re-enable coverage
20 lines
519 B
TypeScript
20 lines
519 B
TypeScript
import { RecoilState, SerializableParam } from 'recoil';
|
|
|
|
import { ComponentFamilyStateKey } from '@/ui/utilities/state/component-state/types/ComponentFamilyStateKey';
|
|
|
|
export const getScopedFamilyStateDeprecated = <
|
|
StateType,
|
|
FamilyKey extends SerializableParam,
|
|
>(
|
|
recoilState: (
|
|
scopedFamilyKey: ComponentFamilyStateKey<FamilyKey>,
|
|
) => RecoilState<StateType>,
|
|
scopeId: string,
|
|
familyKey: FamilyKey,
|
|
) => {
|
|
return recoilState({
|
|
scopeId,
|
|
familyKey: familyKey || ('' as FamilyKey),
|
|
});
|
|
};
|