* Removed console log * Used current scope as default parent scope for fields * Finished editable fields on people show page * Added stories * Console log * Lint
14 lines
307 B
TypeScript
14 lines
307 B
TypeScript
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();
|
|
}
|