chain-call
Build a chain of method calls
Made with ❤ at @outlandish
Install
npm install --save chain-call
yarn add chain-call
Import
// ES6 // CommonJSvar chainCall =
Example
const callApi = // calls api.users().id(59).get().then((response) => response)
API
chainCall(subject, calls)
Chain call methods on an object.
- subject {Object} Object to chain method calls on
- calls {Array} Array of calls to chain
Returns the result of invoking each method in calls
one-by-one
on the return of the previous, beginning with a call on subject
.
Contributing
All pull requests and issues welcome!
If you're not sure how, check out Kent C. Dodds' great video tutorials on egghead.io!
Author & License
chain-call
was created by Sam Gluck and is released under the MIT license.