Feat/editable fields update (#743)
* Removed console log * Used current scope as default parent scope for fields * Finished editable fields on people show page * Added stories * Console log * Lint
This commit is contained in:
@ -0,0 +1,13 @@
|
||||
import { RecoilState, Snapshot } from 'recoil';
|
||||
|
||||
export function getSnapshotScopedState<T>({
|
||||
snapshot,
|
||||
state,
|
||||
contextScopeId,
|
||||
}: {
|
||||
snapshot: Snapshot;
|
||||
state: (scopeId: string) => RecoilState<T>;
|
||||
contextScopeId: string;
|
||||
}) {
|
||||
return snapshot.getLoadable(state(contextScopeId)).valueOrThrow();
|
||||
}
|
||||
11
front/src/modules/ui/recoil-scope/utils/getSnapshotState.ts
Normal file
11
front/src/modules/ui/recoil-scope/utils/getSnapshotState.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import { RecoilState, Snapshot } from 'recoil';
|
||||
|
||||
export function getSnapshotState<T>({
|
||||
snapshot,
|
||||
state,
|
||||
}: {
|
||||
snapshot: Snapshot;
|
||||
state: RecoilState<T>;
|
||||
}) {
|
||||
return snapshot.getLoadable(state).valueOrThrow();
|
||||
}
|
||||
Reference in New Issue
Block a user