Skip to content

Instantly share code, notes, and snippets.

@indongyoo
Created April 3, 2018 12:39
Show Gist options
  • Save indongyoo/4f61700c9c834f13bd75f89c2f65c273 to your computer and use it in GitHub Desktop.
Save indongyoo/4f61700c9c834f13bd75f89c2f65c273 to your computer and use it in GitHub Desktop.
const f9 = pipe(
a => ({ status: a }),
a => Promise.reject('reject!'),
).exception(e => e && e.status == 10) (
e => console.log('e 10')
).error(
e => console.log(e)
).nullable(
e => console.log('nullable~')
);
f9(10); // e 10
f9(null); // nullable~
f9(20); // reject!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment