Files
twenty/packages/twenty-front/src/modules/ui/utilities/recoil-scope/utils/getState.ts
T
Thomas Trompette 6bae6fcdce 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>
2024-01-11 17:44:40 +01:00

11 lines
333 B
TypeScript

import { RecoilState } from 'recoil';
import { StateScopeMapKey } from '@/ui/utilities/recoil-scope/scopes-internal/types/StateScopeMapKey';
export const getState = <StateType>(
stateScopeMap: (stateScopeMapKey: StateScopeMapKey) => RecoilState<StateType>,
scopeId: string,
) => {
return () => stateScopeMap({ scopeId });
};