es6-promise-peek
v1.0.1
Published
Adds a 'peek' function to es6 promises
Readme
es6-promise-peek
Adds a 'peek' function to es6 promises
Easily peek into a promise chain, without affecting the returned value.
Install
$ yarn add es6-promise-peekor
$ npm install --save es6-promise-peekUsage
Promise.resolve("a")
.peek(console.log)
.then(console.log)
.then(console.log)
// => "a"
// => "a"
// => undefinedNB: Return values from the function passed to peek are ignored - even if they are promises.
Environments
This has only been tested on nodejs 6.
Dependencies
License
MIT © [Alastair Brayne]
