Big update!Introducing GitHub Bot Commands. Learn more
Socket
Log inBook a demo

@emotion/weak-memoize

Package Overview
Dependencies
0
Maintainers
4
Versions
13
Issues
File Explorer

Advanced tools

@emotion/weak-memoize

A memoization function that uses a WeakMap

    0.3.0latest

Version published
Maintainers
4
Weekly downloads
7,629,090
decreased by-14.8%

Weekly downloads

Readme

Source

@emotion/weak-memoize

A memoization function that uses a WeakMap

Install

yarn add @emotion/weak-memoize

Usage

Because @emotion/weak-memoize uses a WeakMap the argument must be a non primitive type, e.g. objects, functions, arrays and etc. The function passed to weakMemoize must also only accept a single argument.

import weakMemoize from '@emotion/weak-memoize' let doThing = weakMemoize(({ someProperty }) => { return { newName: someProperty } }) let obj = { someProperty: true } let firstResult = doThing(obj) let secondResult = doThing(obj) firstResult === secondResult // true let newObj = { someProperty: true } let thirdResult = doThing(newObj) thirdResult === firstResult // false

FAQs

What is @emotion/weak-memoize?

A memoization function that uses a WeakMap

Is @emotion/weak-memoize popular?

The npm package @emotion/weak-memoize receives a total of 6,151,655 weekly downloads. As such, @emotion/weak-memoize popularity was classified as popular.

Is @emotion/weak-memoize well maintained?

We found that @emotion/weak-memoize demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.It has 4 open source maintainers collaborating on the project.

Last updated on 31 Jul 2022

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc