tachyon-utils-mem
TypeScript icon, indicating that this package has built-in type declarations

32.0.0 • Public • Published

tachyon-utils-mem

Convenience wrappers around the mem library.

Installation

$ yarn add tachyon-utils-mem

Usage

This package exposes three main memoization strategies:

  • simple: shallow comparison of first argument to a function
  • deep: deep comparison of all arugments to a function
  • lead object keys: shallow comparison of the values of specific keys of the object that is the first argument to a function

Additionally, there is a custom strategy that lets user build cache keys themselves based on the functions args.

These strategies come in both bottomless ("all") and limited ("some", via LRU culling) cache sizes.

Thus, the following functions are available:

  • memoizeSimpleAll
  • memoizeSimpleSome
  • memoizeDeepAll
  • memoizeDeepSome
  • memoizeLeadObjKeysAll
  • memoizeLeadObjKeysSome
  • memoizeCustomAll
  • memoizeCustomSome

Readme

Keywords

none

Package Sidebar

Install

npm i tachyon-utils-mem

Weekly Downloads

2

Version

32.0.0

License

UNLICENSED

Unpacked Size

23.2 kB

Total Files

18

Last publish

Collaborators

  • frgjdhskxjogu