Re:Missing the Point of Promises
by Evbn on Sunday October 21, 2012 @11:26PM
(#4681720)
Not exactly, unless the fulfilledHandler returns a promise. The examples didn't seem to have that requirement.
If fulfilledHandler is a regular function, then then() is just Functor's fmap.
If fulfilledHandler is allowed to be either variant, then you can imagine then() as applying an implicit return when needed, which makes the types a bit less clear
If fulfilledHandler is a regular function, then then() is just Functor's fmap.
If fulfilledHandler is allowed to be either variant, then you can imagine then() as applying an implicit return when needed, which makes the types a bit less clear