JSPM

@bevry/memo

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 27
  • Score
    100M100P100Q39456F
  • License MIT

Wrap a function in a memo to reuse the first invocation result of the function

Package Exports

  • @bevry/memo

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@bevry/memo) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@bevry/memo

Travis CI Build Status NPM version NPM downloads Dependency Status Dev Dependency Status
Patreon donate button Flattr donate button Liberapay donate button Thanks App donate button Boost Lab donate button Buy Me A Coffee donate button Open Collective donate button crypto donate button PayPal donate button Wishlist browse button

Wrap a function in a memo to reuse the first invocation result of the function

Install

npm

  • Install: npm install --save @bevry/memo
  • Require: require('@bevry/memo')

jspm

<script type="module">
    import * as pkg from '//dev.jspm.io/@bevry/memo'
</script>

Editions

This package is published with the following editions:

  • @bevry/memo aliases @bevry/memo/index.js which uses Editions to automatically select the correct edition for the consumers environment
  • @bevry/memo/source/index.ts is typescript source code with import for modules
  • @bevry/memo/edition-browsers/index.js is typescript compiled for browsers with import for modules
  • @bevry/memo/edition-node-11/index.js is typescript compiled for node.js 11 with require for modules
  • @bevry/memo/edition-node-4/index.js is typescript compiled for node.js 4 with require for modules

Usage

API Documentation.

const memo = require('@bevry/memo')

let count = 0
function counter() {
    return ++count
}

const counterMemo = memo(counter)

counterMemo() // returns 1
counterMemo() // returns 1

History

Discover the release history by heading on over to the HISTORY.md file.

Contribute

Discover how you can contribute by heading on over to the CONTRIBUTING.md file.

Backers

Maintainers

These amazing people are maintaining this project:

  • Benjamin Lupton

Sponsors

No sponsors yet! Will you be the first?

Patreon donate button Flattr donate button Liberapay donate button Thanks App donate button Boost Lab donate button Buy Me A Coffee donate button Open Collective donate button crypto donate button PayPal donate button Wishlist browse button

Contributors

These amazing people have contributed code to this project:

Discover how you can contribute by heading on over to the CONTRIBUTING.md file.

License

Unless stated otherwise all works are:

  • Copyright © 2019+ Benjamin Lupton

and licensed under: