PHP 8.2.30
Preview: README.md Size: 740 B
/proc/thread-self/root/home/byroehnu/.trash/node_modules11/@emotion/weak-memoize/README.md

# @emotion/weak-memoize

> A memoization function that uses a WeakMap

## Install

```bash
yarn add @emotion/weak-memoize
```

## Usage

Because @emotion/weak-memoize uses a WeakMap the argument must be a non primitive type, e.g. objects, functions, arrays and etc. The function passed to `weakMemoize` must also only accept a single argument.

```jsx
import weakMemoize from '@emotion/weak-memoize'

let doThing = weakMemoize(({ someProperty }) => {
  return { newName: someProperty }
})

let obj = { someProperty: true }

let firstResult = doThing(obj)

let secondResult = doThing(obj)

firstResult === secondResult // true

let newObj = { someProperty: true }

let thirdResult = doThing(newObj)

thirdResult === firstResult // false
```

Directory Contents

Dirs: 2 × Files: 3

Name Size Perms Modified Actions
dist DIR
- drwxr-xr-x 2026-02-28 00:28:12
Edit Download
src DIR
- drwxr-xr-x 2026-02-28 00:28:22
Edit Download
1.06 KB lrw-r--r-- 2026-02-28 00:26:32
Edit Download
861 B lrw-r--r-- 2026-02-28 00:27:32
Edit Download
740 B lrw-r--r-- 2026-02-28 00:27:50
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).