Migrate record table to scope map (#3363)
* Migrate record table to scope map * Update record scope id to record id * Remove todos and fix edit mode * Fix perf * Fix tests * Fix tests --------- Co-authored-by: Thomas Trompette <thomast@twenty.com> Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -0,0 +1,2 @@
|
||||
export const getScopeIdFromComponentId = (componentId?: string) =>
|
||||
componentId ? `${componentId}-scope` : undefined;
|
||||
@ -0,0 +1,12 @@
|
||||
import { RecoilValueReadOnly } from 'recoil';
|
||||
|
||||
import { StateScopeMapKey } from '@/ui/utilities/recoil-scope/scopes-internal/types/StateScopeMapKey';
|
||||
|
||||
export const getSelector = <StateType>(
|
||||
stateScopeMap: (
|
||||
stateScopeMapKey: StateScopeMapKey,
|
||||
) => RecoilValueReadOnly<StateType>,
|
||||
scopeId: string,
|
||||
) => {
|
||||
return stateScopeMap({ scopeId });
|
||||
};
|
||||
@ -6,5 +6,5 @@ export const getState = <StateType>(
|
||||
stateScopeMap: (stateScopeMapKey: StateScopeMapKey) => RecoilState<StateType>,
|
||||
scopeId: string,
|
||||
) => {
|
||||
return stateScopeMap({ scopeId });
|
||||
return () => stateScopeMap({ scopeId });
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user