WeakMap Module
Functions and values
| Function or value |
Description
|
Full Usage:
cacheConditionally shouldCache valueFactory
Parameters:
'Value -> bool
valueFactory : 'Key -> 'Value
Returns: 'Key -> 'Value
|
Like getOrCreate, but only cache the value if it satisfies the given predicate.
|
Full Usage:
getOrCreate valueFactory
Parameters:
'Key -> 'Value
Returns: 'Key -> 'Value
|
Provides association of lazily-created values with arbitrary key objects. The associated value is created on first request and kept alive only while the key is strongly referenced elsewhere (backed by ConditionalWeakTable). Usage: let getValueFor = WeakMap.getOrCreate (fun key -> expensiveInit key) let v = getValueFor someKey
|
fantomas