Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

memoize-resolver

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

memoize-resolver

A general purpose key resolver for memoize

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
32K
increased by5.66%
Maintainers
1
Weekly downloads
 
Created
Source

memoize-resolver

What is it?

memoize-resolver is a general purpose key resolver for use with a memoize implementation like the one in Lodash.

Why might you need it?

When you memoize a function that receives multiple argments, by default only the first argument is used as the cache key.

The key resolver implemented in memoize-resolver will create a key that's generated from all of the arguments received by the memoized function.

Install

Install the package using NPM:

npm install memoize-resolver --save

And import the function for use with TypeScript or ES2015:

import { createResolver } from "memoize-resolver";

Usage

const work = (state, props) => { /* something expensive */ };
const resolver = createResolver();
const memoizedWork = _.memoize(work, resolver);

Keywords

FAQs

Package last updated on 22 Mar 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc