@mcoffin/side-effect
v0.2.0
Published
Side effect functions on promises
Downloads
40
Readme
side-effect-js
Example
For slightly more complex examples, see test/test.js
.
const sideEffect = require('@mcoffin/side-effect');
const { expect } = require('chai');
Promise.resolve('foo')
.then(sideEffect(console.log))
.then((v) => expect(v).to.equal('foo'));