Mirror of https://github.com/roostorg/coop github.com/roostorg/coop
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at 557ff54b2b435e5f1e789c6a8a4e1bebf2d7deb6 20 lines 725 B view raw
1import _ from 'lodash'; 2import stringify from 'safe-stable-stringify'; 3 4import { 5 getDerivedFieldValue, 6 type DerivedFieldSpec, 7} from '../services/derivedFieldsService/index.js'; 8import { type ItemSubmission } from '../services/itemProcessingService/index.js'; 9import { type TransientRunSignalWithCache } from '../services/orgAwareSignalExecutionService/index.js'; 10 11export default function makeGetDerivedFieldValueWithCache( 12 runSignal: TransientRunSignalWithCache, 13 orgId: string, 14) { 15 return _.memoize( 16 async (itemSubmission: ItemSubmission, input: DerivedFieldSpec) => 17 getDerivedFieldValue(runSignal, orgId, itemSubmission, input), 18 (itemSubmission, input) => stringify([itemSubmission, input]), 19 ); 20}