Guest User

Untitled

a guest
Feb 16th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. // Ignore
  2. const p = Nancy.reject(42)
  3. .then(() => console.log('why')) // ignored
  4. .then(() => console.log('you')) // ignored
  5. .then(() => console.log('ignoring me?!')) // ignored!
  6. // p is a Nancy
  7. // p.state is states.rejected
  8. // p.value is 42
  9.  
  10. const carry = output => input => {
  11. console.log(input);
  12. return output;
  13. };
  14.  
  15. // Chain
  16. Nancy.resolve(0)
  17. .then(carry(1)) // logs 0
  18. .then(carry(2)) // logs 1
  19. .then(carry(3)); // logs 2
Add Comment
Please, Sign In to add comment