2 ms·
You don't need a whole framework to intermediate events and timers. One approach is to have a library that you call instead of the native addEventListener, set
by spankalee 10y ago
You don't need a whole framework to intermediate events and timers.
One approach is to have a library that you call instead of the native addEventListener, setTimeout, etc. method.
Another is to use something like zones.js which does this for basically ever async API in the browser, and then use test utilities that let you play with time, like flushing all timers, or advancing time by specific amounts.
- tynpeddler 10y agoBut if you write your library to use those sorts of tools, then you now have a dependency, which the article is arguing against doing.
- spankalee 10y agoThe article is not arguing against dependencies. It's arguing against tying your library to a specific web framework.