Create a memoization in context to store the result of a getter function
• T
ContextMemoryOptions
new ContextMemoization<
T
>(getter
,options
):ContextMemoization
<T
>
• getter
• options: Partial
<ContextMemoryOptions
> = {}
packages/core/src/utils/context.ts:111
getMemoizationMap: () =>
undefined
|WeakMap
<WeakKey
,any
>
undefined
| WeakMap
<WeakKey
, any
>
ContextMemoryOptions.getMemoizationMap
packages/core/src/utils/context.ts:120
readonly
getter: () =>T
T
packages/core/src/utils/context.ts:112
readonly
key:WeakKey
ContextMemoryOptions.key
packages/core/src/utils/context.ts:121
clear():
undefined
|boolean
Clear the memoization
undefined
| boolean
true if the memoization is cleared, undefined if the context is not found
packages/core/src/utils/context.ts:142
exists():
undefined
|boolean
Check if the memoization exists
undefined
| boolean
true if the memoization exists, undefined if the context is not found
packages/core/src/utils/context.ts:152
get():
T
Get the value in memoization or call the getter function
T
the value of the getter function
packages/core/src/utils/context.ts:127
set(
value
):undefined
|WeakMap
<WeakKey
,any
>
Set a new value to the memoization
• value: T
the new value to set
undefined
| WeakMap
<WeakKey
, any
>
the memoization map or undefined if the context is not found
packages/core/src/utils/context.ts:163
static
assignMemoizationMap(target
):WeakMap
<WeakKey
,any
>
• target: ContextMemoryContainer
WeakMap
<WeakKey
, any
>
packages/core/src/utils/context.ts:169