diff --git a/History.md b/History.md index 0905757..614a16a 100644 --- a/History.md +++ b/History.md @@ -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). diff --git a/README.md b/README.md index 92553a0..f4a902b 100644 --- a/README.md +++ b/README.md @@ -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: ```javascript