{"name":"@emotion/weak-memoize","version":"0.4.0","description":"A memoization function that uses a WeakMap","main":"dist/emotion-weak-memoize.cjs.js","module":"dist/emotion-weak-memoize.esm.js","types":"dist/emotion-weak-memoize.cjs.d.ts","license":"MIT","repository":{"type":"git","url":"git+https://github.com/emotion-js/emotion.git#main"},"scripts":{"test:typescript":"dtslint types"},"publishConfig":{"access":"public"},"devDependencies":{"@definitelytyped/dtslint":"0.0.112","typescript":"^5.4.5"},"exports":{".":{"module":"./dist/emotion-weak-memoize.esm.js","import":"./dist/emotion-weak-memoize.cjs.mjs","default":"./dist/emotion-weak-memoize.cjs.js"},"./package.json":"./package.json"},"gitHead":"d57cfcb6daf48fc5458f91b4db2e072fbc2863e4","bugs":{"url":"https://github.com/emotion-js/emotion/issues"},"homepage":"https://github.com/emotion-js/emotion/tree/main#readme","_id":"@emotion/weak-memoize@0.4.0","_nodeVersion":"16.20.2","_npmVersion":"8.19.4","dist":{"integrity":"sha512-snKqtPW01tN0ui7yu9rGv69aJXr/a/Ywvl11sUjNtEcRc+ng/mQriFL0wLXMef74iHa/EkftbDzU9F8iFbH+zg==","shasum":"5e13fac887f08c44f76b0ccaf3370eb00fec9bb6","tarball":"http://registry-npm.ywwl.com/@emotion/weak-memoize/download/@emotion/weak-memoize-0.4.0.tgz","fileCount":16,"unpackedSize":5807,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBj2x05KPyOjAeeqDxKsBLDOQMQbt/ySKMsrFO9e4PwNAiBO5+tC57uJSGMCjYvaJ+Ke2kQeJ64q4jn69pqf/ADA1w=="}],"size":2359,"noattachment":false,"key":"/@emotion/weak-memoize/-/@emotion/weak-memoize-0.4.0.tgz"},"_npmUser":{"name":"emotion-release-bot","email":"emotion-release-bot@hamil.town"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/weak-memoize_0.4.0_1721371919640_0.5692501995695682"},"_hasShrinkwrap":false,"readme":"# @emotion/weak-memoize\n\n> A memoization function that uses a WeakMap\n\n## Install\n\n```bash\nyarn add @emotion/weak-memoize\n```\n\n## Usage\n\nBecause @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.\n\n```jsx\nimport weakMemoize from '@emotion/weak-memoize'\n\nlet doThing = weakMemoize(({ someProperty }) => {\n  return { newName: someProperty }\n})\n\nlet obj = { someProperty: true }\n\nlet firstResult = doThing(obj)\n\nlet secondResult = doThing(obj)\n\nfirstResult === secondResult // true\n\nlet newObj = { someProperty: true }\n\nlet thirdResult = doThing(newObj)\n\nthirdResult === firstResult // false\n```\n","publish_time":1721371919797,"maintainers":[{"name":"emmatown","email":"npm@emmas.town"},{"name":"tkh44","email":"kye.hohenberger@gmail.com"},{"name":"emotion-release-bot","email":"emotion-release-bot@hamil.town"},{"name":"andarist","email":"mateuszburzynski@gmail.com"}],"_cnpm_publish_time":1721371919797,"dist-tags":{"latest":"0.4.0","really-unsafe-please-do-not-use":"10.0.0-really-unsafe-please-do-not-use.2"}}