# alexreardon/memoize-one

A memoization library which only remembers the latest invocation

Repository: https://github.com/alexreardon/memoize-one
Canonical: https://ross.abutalabs.com/products/memoize-one
Language: TypeScript
License: MIT
License Family: permissive
Topics: javascript, memoize, performance, memoization
Last push: 2023-01-08T21:07:38+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 3498, "days_push": 1333, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2967, forks 80 (observed 2026-08-28T04:07:32.598148+00:00)

## What it is
A tiny TypeScript memoization library that caches only the result of the most recent function invocation, avoiding memory leaks from unbounded caches. It uses fast shallow argument equality by default with support for custom equality functions.

## Use cases
- memoize expensive pure functions in JavaScript
- cache only the latest function result to avoid memory leaks
- skip recomputation when arguments haven't changed
- memoize React render helpers or selectors
- avoid cache busting config like maxSize or maxAge
- memoize functions with custom equality checks

## When to choose
- you only need last-call caching and want a tiny, dependency-free library
- you worry about memory leaks from unbounded memoization caches
- you want TypeScript/Flow types out of the box

## When to avoid
- you need multi-entry caching with maxSize, TTL, or LRU eviction
- you need to memoize async functions returning promises (use async-memoize-one instead)
- arguments are large objects needing deep equality on every call

## Facets
- artifact type: library
- maturity: stable
- function: caching
- domain: developer-tools, web-development, frontend, performance
- platform: browser
- tags: memoization, cache, typescript, flow, zero-dependency, memory-safe, performance, nodejs, javascript

## Member repositories
- alexreardon/memoize-one (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:32.598148+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T07:31:53.283378+00:00, confidence not recorded.
  - readme: https://github.com/alexreardon/memoize-one (fetched 2026-08-28T04:07:32.598148+00:00, sha c8c2304df4d9)
  - registry_npm: https://registry.npmjs.org/memoize-one (fetched 2026-08-29T09:47:22.151974+00:00, sha 99ecf153e2b0)
- Data as of 2026-08-30T08:39:29.467469+00:00.
