curl-client icon indicating copy to clipboard operation
curl-client copied to clipboard

Promise logic is broken

Open nicolas-grekas opened this issue 6 years ago • 0 comments

  • the return value of rejection callback should reinject to fulfill the promise and recover from the error - this is not supported
  • chaining promises/callbacks is wrong, see https://blog.domenic.me/youre-missing-the-point-of-promises/
  • return from a promise can be a promise too, in which case it should we unwrapped - detailed in #32 already

I'd recommend relying on guzzle/promise to fix all these issues as the implementation there is correct. See also https://promisesaplus.com/

nicolas-grekas avatar Oct 03 '19 21:10 nicolas-grekas