-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AsyncIterator-ext Package #66
Comments
I'm not opposed, but I wonder if that's needed. AsyncIterator should be split into multiple files, and then people can just import what they need? |
As long as you are happy to include that kind of functionality in the main package I'm happy to split the files and add these extensions as separate files once all of the current work around perf. settles down. |
If we're talking about something for the next major release, I would also suggest getting rid of commodity prototypal methods entirely as they bind classes to one another, preventing tree-shaking. |
Which ones? |
Indeed! Stay tuned; health and time permitting, I'll get to the perf issues and prepare the next release. |
@RubenVerborgh the fact that A potential solution would be to have top-level API-wise this would be a major major breaking change, though. Not sure whether the gains in bundle size would be worth the refactoring costs.
Hope you're ok! Health comes first! |
Thanks! I think it's quite okay and in fact crucial to have these methods, for performance and other reasons. (If they're methods, then subclasses can redefine them for more optional ones.) Some iterators are just core and don't need shaking off (we're talking about 3–4 iterators). |
In order to support some more niche use-cases I am coming across I was wondering if it is worth creating an
AsyncIterator-ext
package (see example below).IMO the best way to go about this would be:
AsyncIterator
organisationAsyncIterator
repo to a repo in this organisation [Requires @RubenVerborgh due to repo permissions]@asynciterator/extension-name
schema (I am happy to take responsibility for maintenance of this new repo)@asynciterator/ext
The downside of having these in a separate package is that it is hard to use these functions as methods of an iterator (as if we just extended the existing
AsyncIterator
with anAsyncIteratorExt
class then using a method likemap
would return anAsyncIterator
class without any of the extension functionality).An example of an export from that package would be the following
maybeIterator
function which returns undefined on emptyIterators and an iterator otherwise (the use case for me is to terminate a forward chaining procedure in reasoning components):The text was updated successfully, but these errors were encountered: