Skip to content

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

License

Notifications You must be signed in to change notification settings

fabiospampinato/lomemo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 --save lomemo

Usage

import lomemo from 'lomemo';

// 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

// 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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published