-
Notifications
You must be signed in to change notification settings - Fork 323
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
Chainable API #415
Comments
Do modifications to the Array.prototype make the |
I'm not familiar with that flag. Is that a webpack specific flag? I think it would, but the side-effects modules could be published under a different package name while reusing code to avoid such. |
After looking at some docs it looks like this can be set to true for only some modules. e.g. "sideEffects": ["./src/$/**/*.ts"] |
mutating Array.prototype doesn't sound like the best idea to me |
Understandably IMO. Historically this is considered unsafe but with the introduction of |
I just discovered this library and it looks great. What do you think of supporting a chainable API too?
Pure functions are nice but when a developer needs to use multiple methods in a row it gets annoying to have to define intermediary variables or to nest function calls. JavaScript doesn't have a pipeline operator but prototypes can be safely augmented these days using symbols (rather than strings which can cause conflicts because they are not unique).
Example
Implementation
Augmenting modules should be able to be programmatically generated from pure functions (e.g. using ts-morph):
The text was updated successfully, but these errors were encountered: