I've taken a very quick look at the code, because I like the idea of typescript + dataloader wo/ caching, but I'm finding the underlying mechanisms seems to be quite different.
DataLoader, when run on Node, relies on process.nextTick
-see enqueuePostPromiseJob
- to maximize performance, setImmediate
on browsers where it's available, or setTimeout
as a fallback, as it's the least performant.
As far as I could see, this module is simply using setTimeout
with a delay in order to batch all requests within a time frame which, I would consider a nice extra feature, but not great as a default. I was wondering whether there was a particular reasoning behind it, or whether maybe I just got this whole thing wrong.
Thanks!