@ultraq/function-utils
TypeScript icon, indicating that this package has built-in type declarations

0.5.2 • Public • Published

function-utils

Build Status codecov npm Bundlephobia minified size

A collection of utilities for JavaScript functions.

Installation

npm install @ultraq/function-utils

API

memoize(func)

A higher-order function to apply memoization, returning a memozied version of the wrapped function.

If memoizing a recursive function, then memoize and define the function at the same time so you can make a call to the memoized function, eg:

const myFunction = memoize(() => myFunction());
  • func: the function to memoize

Dependents (1)

Package Sidebar

Install

npm i @ultraq/function-utils

Weekly Downloads

1,842

Version

0.5.2

License

Apache-2.0

Unpacked Size

16.8 kB

Total Files

7

Last publish

Collaborators

  • ultraq