lomemo
Lodash's memoize function, but in a much smaller package than lodash.memoize's.
Last updated 2 years ago by fabiospampinato .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install lomemo 
SYNC missed versions from official npm registry.

Lomemo

Lodash's memoize function, but in a much smaller package than lodash.memoize's.

Read lodash's docs for more info.

Install

npm install lomemo

Usage

import lomemo from 'lomemo';

// Let's memoize a function, using the first argument as the key

const memoized = lomemo ( ( a, b ) => a + b );

memoized ( 1, 2 ); // => 3
memoized ( 1, 5 ); // => 3

// Let's memoize a function, using a custom function to generate the key

const resolver = ( ...args ) => args.join ( '' );
const memoized = lomemo ( ( a, b ) => a + b, resolver );

memoized ( 1, 2 ); // => 3
memoized ( 1, 5 ); // => 6
memoized ( '', '15' ); // => 6

License

MIT © lodash

Current Tags

  • 1.0.1                                ...           latest (2 years ago)

2 Versions

  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Total 6
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (3)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE