Looks like a cool concept.

Looks like a cool concept. But unless I’m missing something it doesn’t really much different than wrapping the promise yourself.

You can of course replace `stripe.charges.create` completely if you want to but I think not overriding the library method might have less side effects.

By just natively wrapping the Promise you get clearer code for anyone who knows how to work with Promises. Even without comments it’s clear which code runs first which one later and what will happen in case `stripe.charges.create` fails.

“Looks like a cool concept.” Posted first on ” JavaScript on Medium “
Author: Yoni Jah

Author: Pawan Kumar

Leave a Reply

Close Menu
%d bloggers like this:
Skip to toolbar