({ context, initList = defaultInitList }: InitProps)
| 34 | * it delegates the actual caching to each "initFunction" |
| 35 | */ |
| 36 | export const initMemoryCache = async ({ context, initList = defaultInitList }: InitProps) => { |
| 37 | console.log(`// Initializing in-memory cache for ${initList.join(', ')}…`) |
| 38 | const data: any = {} |
| 39 | for (const initFunctionName of initList) { |
| 40 | const f = initFunctions[initFunctionName] |
| 41 | const result = await f({ context }) |
| 42 | data[initFunctionName] = result |
| 43 | } |
| 44 | return data |
| 45 | } |
| 46 | |
| 47 | interface InitDbCacheProps extends InitProps { |
| 48 | data: any |
no outgoing calls
no test coverage detected