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

Function createFastMemoizeCache

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

Source from the content-addressed store, hash-verified

91}
92
93function createFastMemoizeCache<V>(
94 store: Record<string, V | undefined>
95): Cache<string, V> {
96 return {
97 create() {
98 return {
99 get(key) {
100 return store[key]
101 },
102 set(key, value) {
103 store[key] = value
104 },
105 }
106 },
107 }
108}
109
110/**
111 * Create intl formatters and populate cache

Callers 1

createFormattersFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected