2 ms·
I get what you're saying, but for some reason it doesn't feel right to me. Part of it is that if your API requires you to think about whether or not it will ru
by erikpukinskis 11y ago
I get what you're saying, but for some reason it doesn't feel right to me.
Part of it is that if your API requires you to think about whether or not it will run in the current or next tick, that's probably not the right API.
I find in JavaScript it's best to just assume your callbacks could be called at any time, in any order. And if you need a specific priority then write some code that actually explicitly orchestrates that.
- viperscape 11y agoI find that hard to do when some libraries make heavy use of async, you basically have to bend to the library when writing your own code
- erikpukinskis 11y agoI don't blame you. I basically don't use any libraries any more because the proliferation of promises (and libraries with promise-like architectures) has made everything impossible to reason about or debug. But I have the luxury of being a wizard in the forest who answers to no one.