News for hackers. Stuff that matters.
Re:jQuery 3.0 Release Candidate by therealmarv on Tuesday May 24, 2016 @11:05AM (#11762172)
+1 for fetch. Use the good github fetch polyfill for old browsers https://github.com/github/fetch
Re:jQuery 3.0 Release Candidate by nilliams on Tuesday May 24, 2016 @02:01PM (#11763970)
I tried fetch, the polymorphic-fetch module that builds on this github one and found it doesn't support .finally(), or work with the promise.finally polyfill (yes I know it's not in the spec, but seriously).

Also sinon.js couldn't mock it, and dealing with error cases is inelegant (it doesn't look like much extra code, but is hard to justify if you're just writing a small component that hits one endpoint, in terms of weird new code to explain to your teammates that is).

I have gone back to $.ajax for now, though I do mean to try out qwest [1] when I get the chance. Seems to be both tiny and also have a sane promise-y API.

[1] https://github.com/pyrsmk/qwest

Re:jQuery 3.0 Release Candidate by therealmarv on Tuesday May 24, 2016 @06:58PM (#11766255)
Why you want stuff which is not in the spec? It's not in the spec it's not in the polyfill :/ Why the fetch from Github is not good enough for you?
Re:jQuery 3.0 Release Candidate by nilliams on Wednesday May 25, 2016 @03:02AM (#11768120)
Because needing to do something regardless of success or failure is incredibly common (e.g. stop a progress bar, re-enable form inputs & buttons).

The (promises) spec is lacking w.r.t. this use-case, and most ajax libraries (and a lot or promise libraries) recognise this by implementing a 'finally' equivalent.