Thursday 24 May 2018

angular - Promise vs Observable for Http in Angular2?

Essentially, what the title says, is there any reason to use an observable over a promise for the purposes of making http calls? Seems like needless overcomplication, since all the call will do is succeed or fail, and there is no real reason to cancel it, virtually ever. Asking this for the typical use-case, not for the typical observables sales-pitch of debounce (which, ironically, ng-debounce does just fine anyway, without making useless calls).

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...