denim-memoize

1.0.2 • Public • Published

denim-memoize

This utility was built to generically memoize a function.

Getting Started

yarn add denim-memoize

Prerequisites

None

Installing

Clone the repo

yarn add denim-memoize

ES6 Import

import memoizeFactory from 'denim-memoize'

CommonJS

const memoizeFactory = require('denim-memoize')

Usage

import memoizeFactory from 'denim-memoize'

const myFunction = () => {
  return 'Hello Memoizer'
}

const memoizedMyFunction = memoizeFactory(myFunction)

// to get memoization, now just use memoizedMyFunction in place of myFunction

let result = memoizedMyFunction()

Running the tests

yarn test

Deployment

yarn publish --new-version NEWVER

Built With

  • node - Node 9.2.0
  • jest - Jest testing
  • chai - Assertion Library

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Package Sidebar

Install

npm i denim-memoize

Weekly Downloads

2

Version

1.0.2

License

MIT

Last publish

Collaborators

  • nsberndt
  • michaelwclark