Package Exports
- sb-memoize
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 (sb-memoize) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Memoize
Memoize is a javascript helper utility to fulfill your function memoization needs.
Installation
npm install --save sb-memoizeAPI
function memoize(
callback: Function,
options = { async: false }
): Function
module.exports = memoizeExamples
import resolve from 'resolve'
import promisify from 'sb-promisify'
import memoize from 'sb-memoize'
const resolveSync = memoize(resolve.sync)
const resolveAsync = memoize(promisify(resolve), { async: true })
console.log(resolveSync('sb-memoize', { basedir: __dirname }))
resolveAsync('sb-memoize', { basedir: __dirname })
.then(function(path) {
console.log(path)
})Notes
This package automatically adds these methods on any memoized function
clearCache(): void
getCache(parameters: Array<any>): any
setCache(parameters: Array<any>, cacheValue: any): void
deleteCache(parameters: Array<any>): voidLicense
This project is licensed under the terms of MIT License, see the LICENSE file for more info