|
|
|
|
|
by khalidx
543 days ago
|
|
This is nicely done. One function I've written that I frequently use is a generic iterate <T> function which (in JS/TS land) allows you to loop over a T[], Array<T>, ArrayLike<T>, Iterable<T>, AsyncIterable<T>, including generators and async generators. It is just easier to always be able to write: "for await (const item of iterate(iterable))" in most places, without worrying about the type of the item I am looping over. I like the reducers and collectors in your library! Going to try it out. Also, something new I discovered is the Array.fromAsync() method in JS, which is like Array.from() but for async values. I don't think it is available in all browsers/runtimes yet though. |
|
I actually have a TODO for what you're describing haha
https://github.com/TomerAberbach/lfi/blob/69cdca0b2ee2bd078f...