Browse Source

promise example, history.md update for 1.3.0

feature/remove-domains 1.3.0
Bryan Donovan 9 years ago
parent
commit
029a85d947
  1. 3
      History.md
  2. 11
      README.md

3
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).

11
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

Loading…
Cancel
Save