MCPcopy Index your code
hub / github.com/formatjs/formatjs / createFastMemoizeCache

Function createFastMemoizeCache

packages/utils/defaultTimezone.ts:5–20  ·  view source on GitHub ↗
(
  store: Record<string, V | undefined>
)

Source from the content-addressed store, hash-verified

3const cache: Record<string, Intl.DateTimeFormat> = {}
4
5function createFastMemoizeCache<V>(
6 store: Record<string, V | undefined>
7): Cache<string, V> {
8 return {
9 create() {
10 return {
11 get(key) {
12 return store[key]
13 },
14 set(key, value) {
15 store[key] = value
16 },
17 }
18 },
19 }
20}
21
22type DTFParameters = ConstructorParameters<typeof Intl.DateTimeFormat>
23

Callers 1

defaultTimezone.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected