make-cacheable
Decorates functions to cache their results in a given catbox cache client.
Installation
npm install make-cacheable
Usage
// CommonJS// const makeCacheable = require('make-cacheable'); // ES6; ; // See https://github.com/hapijs/catbox#clientconst cacheClient = /* ... */; { /* ... */} const cachedFunction = ; async { let result = await ; // Cached! result = await ; // Cache values on demand await cachedFunction;};
Testing
Clone the repository and execute:
npm test
Contribute
- Fork it:
git clone https://github.com/softonic/make-cacheable.git
- Create your feature branch:
git checkout -b feature/my-new-feature
- Commit your changes:
git commit -am 'Added some feature'
- Check the build:
npm run build
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D