@ -1,3 +1,6 @@
- 1.3.0 2016-01-26
- Promise support (#39, #24) - @PuKoren
- 1.2.2 2015-10-19
- Bugfix: Fixing domain error issues when error is thrown inside 'work' function (#28).
@ -138,6 +138,17 @@ memoryCache.wrap(key, function (cb) {
// { id: 123, name: 'Bob' }
```
#### Example Using Promises
```javascript
memoryCache.wrap(key, function() {
return getUserPromise(userId);
});
then(function(user) {
console.log('User:', user);
Here's a very basic example of how you could use this in an Express app: