Skip to content

Commit

Permalink
Add Cancellation Example
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamingr committed Aug 29, 2016
1 parent fe541fb commit f00a8d4
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions docs/docs/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,7 @@ var p = Promise.resolve('./config.json')
.timeout(2000)
.catch(console.error.bind(console, 'Failed to load config!'))
.then(fs.readFileAsync)
.then(function(data) {
return JSON.parse(data);
});
.then(JSON.parse);
// Listen for exception event to trigger promise cancellation
process.on('unhandledException', function(event) {
// cancel config loading
Expand Down

0 comments on commit f00a8d4

Please sign in to comment.