Function
remember
(key: K, factory: () => V)
Source from the content-addressed store, hash-verified
| 21 | }, |
| 22 | |
| 23 | remember(key: K, factory: () => V) { |
| 24 | let result = map.get(key) |
| 25 | |
| 26 | if (result && result.expiration > new Date()) { |
| 27 | return result.value |
| 28 | } |
| 29 | |
| 30 | map.delete(key) |
| 31 | |
| 32 | let value = factory() |
| 33 | this.set(key, value) |
| 34 | return value |
| 35 | }, |
| 36 | |
| 37 | set(key: K, value: V) { |
| 38 | let expiration = new Date() |
Callers
nothing calls this directly
Tested by
no test coverage detected
Used in the wild real call sites across dependent graphs
searching dependent graphs…