Exciting news!Announcing our $4.6M Series Seed. Learn more
Socket
LoveBlogFAQ
Install
Log in

memoize-id

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Issues
File Explorer

Advanced tools

memoize-id

Memoize a function by the identity of its arguments, using ES2015 Map

    1.0.0latest

Version published
Maintainers
1
Yearly downloads
7,495
decreased by-93.46%

Weekly downloads

Changelog

Source

  • Merge pull request #66 from elliottsj/renovate/configure 899cf68
  • Use "config:js-lib" preset c0e6656
  • Add renovate.json 75804e1
  • Merge pull request #65 from elliottsj/upgrade 756d145
  • Use latest deps, remove ESLint, use GH actions 85685d4
  • Merge pull request #60 from elliottsj/greenkeeper/babel-jest-23.0.0 68b8771
  • chore(package): update lockfile 088691e
  • chore(package): update babel-jest to version 23.0.0 2d1834e
  • Merge pull request #59 from elliottsj/update-babel-jest d77a136
  • Upgrade to [email protected]^22.4.1 c4ce01f
  • Merge pull request #58 from elliottsj/update-jest 692c836
  • Upgrade to [email protected]^22.4.2 2384ce8
  • Merge pull request #50 from elliottsj/greenkeeper/babel-eslint-8.0.0 30f63be
  • Merge pull request #57 from elliottsj/node-6-and-up ea931c6
  • Travis: test on node>=6 8cedf81
  • chore(package): update lockfile 2d9464a
  • chore(package): update babel-eslint to version 8.0.0 38fd6e9
  • Merge pull request #52 from elliottsj/babel-jest 9452409
  • Merge pull request #51 from elliottsj/babel-cli 1dd9de0
  • Upgrade babel-jest to 21.2.0 8191cd7
  • Upgrade babel-cli to 6.26.0 5316842
  • Merge pull request #48 from elliottsj/greenkeeper/babel-jest-21.0.0 913951b
  • chore(package): update lockfile d72fe04
  • Install babel-core 2d73eaa
  • chore(package): update babel-jest to version 21.0.0 ea6ece4
  • Merge pull request #49 from elliottsj/greenkeeper/jest-cli-21.0.0 6ac42c6
  • chore(package): update lockfile 23015b1
  • chore(package): update jest-cli to version 21.0.0 154d6da
  • Merge pull request #47 from elliottsj/greenkeeper/eslint-4.2.0 3650b69
  • chore(package): update lockfile 4b7df3d
  • chore(package): update eslint to version 4.2.0 796e551
  • Merge pull request #46 from elliottsj/travis-token 722ae37
  • Use correct Travis CI token da4506e
  • Merge pull request #44 from elliottsj/greenkeeper/initial c0398b5
  • Use prettier 4162476
  • Use yarn 1e7965d
  • docs(readme): add Greenkeeper badge 5959e88
  • chore(package): update dependencies 6d18cad
  • Merge pull request #43 from elliottsj/doppins/jest-cli-from-16.0.0-below-17.0.0 1eccb18
  • Merge pull request #42 from elliottsj/doppins/babel-jest-from-16.0.0-below-17.0.0 a794f21
  • Upgrade dependency jest-cli to ^16.0.0 d640c2d
  • Upgrade dependency babel-jest to ^16.0.0 7e3f7cf
  • Merge pull request #38 from elliottsj/doppins/eslint-config-airbnb-base-from-7.1.0-below-8.0.0 030b48f
  • Disable ESLint arrow-parens 7c37f0b
  • Test Node.js v4 & v6 2ba065c
  • Upgrade dependency eslint-config-airbnb-base to ^7.1.0 a9dc421
  • Merge pull request #37 from elliottsj/doppins/jest-cli-from-15.1.1-below-16.0.0 0d4457b
  • Merge pull request #36 from elliottsj/doppins/babel-jest-from-15.0.0-below-16.0.0 74c3505
  • Upgrade dependency jest-cli to ^15.1.1 49e4983
  • Upgrade dependency babel-jest to ^15.0.0 48a042c
  • Merge pull request #34 from elliottsj/doppins/babel-jest-from-14.0.0-below-15.0.0 066cab2
  • Merge pull request #35 from elliottsj/doppins/jest-cli-from-14.0.0-below-15.0.0 8cb8be3
  • Upgrade dependency jest-cli to ^14.0.0 984e407
  • Upgrade dependency babel-jest to ^14.0.0 1b8457e
  • Merge pull request #33 from elliottsj/doppins/eslint-config-airbnb-base-from-5.0.0-below-6.0.0 d5cdec4
  • Upgrade eslint to ^3.1.1 173d688
  • Upgrade eslint-plugin-import to ^1.11.1 b5dc0ab
  • Upgrade dependency eslint-config-airbnb-base to ^5.0.0 e39f78a
  • Merge pull request #31 from elliottsj/doppins/eslint-from-3.0.0-below-4.0.0 ca5c31c
  • Upgrade dependency eslint-plugin-import to ^1.10.2 131ab81
  • Merge origin/doppins/eslint-config-airbnb-base-from-4.0.0-below-5.0.0 into doppins/eslint-from-3.0.0-below-4.0.0 0ad1726
  • Upgrade dependency eslint-config-airbnb-base to ^4.0.0 8b99649
  • Upgrade dependency eslint to ^3.0.1 4761f49
  • Upgrade dependency eslint to ^3.0.0 46b7dd8
  • Merge pull request #30 from elliottsj/doppins/jest-cli-from-13.0.0-below-14.0.0 6452b1a
  • Merge pull request #29 from elliottsj/doppins/babel-jest-from-13.0.0-below-14.0.0 0cbb15c
  • Upgrade dependency jest-cli to ^13.0.0 6467221
  • Upgrade dependency babel-jest to ^13.0.0 2424636
  • Merge pull request #28 from elliottsj/doppins/eslint-config-airbnb-base-from-3.0.0-below-4.0.0 f864f28
  • chore: upgrade eslint-plugin-import to ^1.7.0 a720a70
  • Upgrade dependency eslint-config-airbnb-base to ^3.0.1 64de82a
  • Upgrade dependency eslint-config-airbnb-base to ^3.0.0 4706ca0
  • Merge pull request #27 from elliottsj/doppins/witty-initial-upgrade 3636a7e
  • Upgrade eslint-plugin-import to ^1.6.1 2a74328
  • Upgrade eslint to ^2.9.0 3479a4b
  • Upgrade dependency eslint-config-airbnb-base to ^2.0.0 d8aefc7
  • Merge pull request #26 from elliottsj/greenkeeper-babel-jest-12.0.2 49aa5da
  • chore(package): update babel-jest to version 12.0.2 20b200a
  • Merge pull request #25 from elliottsj/greenkeeper-jest-cli-12.0.1 5060b53
  • chore(package): update jest-cli to version 12.0.1 a2385e2
  • Merge pull request #22 from elliottsj/greenkeeper-eslint-config-airbnb-8.0.0 9692e48
  • Switch to eslint-config-airbnb-base 65bb570
  • chore(package): update eslint-config-airbnb to version 8.0.0 7b90f14
  • Merge pull request #21 from elliottsj/greenkeeper-jest-cli-11.0.0 bab4322
  • Merge pull request #20 from elliottsj/greenkeeper-babel-jest-11.0.0 36ac2ee
  • chore(package): update jest-cli to version 11.0.0 cfb7dd7
  • chore(package): update babel-jest to version 11.0.0 5195492
  • Merge pull request #19 from elliottsj/greenkeeper-eslint-config-airbnb-7.0.0 3e9ce7d
  • Use eslint-config-airbnb/base 3b66146
  • chore(package): update eslint-config-airbnb to version 7.0.0 2505d07
  • Merge pull request #18 from elliottsj/babel-eslint-6.0.2 dc8b4ba
  • npm i [email protected] --save-dev 79e43ec
  • Merge pull request #15 from elliottsj/greenkeeper-babel-jest-10.0.2 7d0138a
  • chore(package): update babel-jest to version 10.0.2 feda8f6
  • Merge pull request #17 from elliottsj/revert-16-greenkeeper-jest-cli-10.0.2 ad92271
  • Revert "Update jest-cli to version 10.0.2 🚀" cbdb637
  • Merge pull request #16 from elliottsj/greenkeeper-jest-cli-10.0.2 50c8086
  • chore(package): update jest-cli to version 10.0.2 5e12a83
  • Merge pull request #13 from elliottsj/greenkeeper-babel-jest-10.0.1 997dd9e
  • Merge pull request #14 from elliottsj/greenkeeper-jest-cli-0.10.0 9ffead0
  • chore(package): update jest-cli to version 0.10.0 c3dd080
  • chore(package): update babel-jest to version 10.0.1 e64c7b0
  • Merge pull request #12 from elliottsj/greenkeeper-eslint-2.5.0 97f4604
  • chore(package): update eslint to version 2.5.0 fc795e1
  • Merge pull request #11 from elliottsj/greenkeeper-eslint-2.4.0 6f384f3
  • npm install [email protected] de1367b
  • chore(package): update eslint to version 2.4.0 820cc49

https://github.com/elliottsj/memoize-id/compare/v0.2.0...v1.0.0

Readme

Source

memoize-id npm

Memoize a function by the identity of its arguments, using ES2015 Map.

Installation

npm install memoize-id

Note: ES2015 Symbol and Map must be available where memoize-id is used. Refer to ECMAScript 6 compatibility table.

Usage

import memoize from 'memoize-id'; // or: // const memoize = require('memoize-id').default; let i = 0; function fn(foo, bar, baz) { i += 1; return { args: [foo, bar, baz], i, }; } const memoizedFn = memoize(fn); console.log(i); // 0 const v1 = memoizedFn('foo', 'bar', 'baz'); console.log(v1); // { args: ['foo', 'bar', 'baz'], i: 1 } console.log(i); // 1 const v2 = memoizedFn('foo', 'bar', 'baz'); console.log(v2); // { args: ['foo', 'bar', 'baz'], i: 1 } console.log(v1 === v2); // true console.log(i); // 1 const v3 = memoizedFn('foo', 'qux', 'baz'); console.log(v3); // { args: ['foo', 'qux', 'baz'], i: 2 } console.log(i); // 2 console.log(v1 == v3); // false

Keywords

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