Refactor recoil scope states (#3097)

* Refactor recoil scope states

* Complete refactoring

* Fix
This commit is contained in:
Charles Bochet
2023-12-21 14:25:18 +01:00
committed by GitHub
parent b416b0f98f
commit e9bc13b5fa
30 changed files with 347 additions and 258 deletions

View File

@ -0,0 +1,19 @@
import { RecoilState, SerializableParam } from 'recoil';
import { ScopedFamilyStateKey } from '../scopes-internal/types/ScopedFamilyStateKey';
export const getScopedFamilyStateDeprecated = <
StateType,
FamilyKey extends SerializableParam,
>(
recoilState: (
scopedFamilyKey: ScopedFamilyStateKey<FamilyKey>,
) => RecoilState<StateType>,
scopeId: string,
familyKey: FamilyKey,
) => {
return recoilState({
scopeId,
familyKey: familyKey || ('' as FamilyKey),
});
};