memorizer
memoize a getter of an object
Last updated 9 years ago by jongleberry .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install memorizer 
SYNC missed versions from official npm registry.

memorizer

NPM version build status Test coverage

Memoize a property with a lazy callback. Great for creating internal promises or computationally expensive rproperties.

const memoize = require('memorizer')

function Constructor () {
  this.promise.then(val => {
    // val === true
  })
}

memoize(Constructor.prototype, 'promise', function () {
  return new Promise(true)
})

API

memoize(object: Object, property: String, getter: Function)

The getter's return value will be memoized.

Current Tags

  • 1.0.1                                ...           latest (9 years ago)

2 Versions

  • 1.0.1                                ...           9 years ago
  • 1.0.0                                ...           10 years ago
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (2)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |