Replies: 1 comment
-
The problem is that passing |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The problem is that passing |
Beta Was this translation helpful? Give feedback.
-
I'm working on a project that includes many functions with rest parameters, ie:
Babel transpiles this by injecting per-basis helper code, thus:
This works, but in my case leads to a lot of almost identical code.
Instead, how about creating a new catch-all helper to abstract this logic away?
This could then be applied thus:
Or, if the rest parameter is not the first:
I appreciate this would add needless bloat if there is only a single rest parameter in a project, so perhaps it would have to be used conditionally or as an opt-in feature. Anyway, I'm curious if this has been discussed before and whether there are any other factors I'm overlooking which would make something like this unviable.
Beta Was this translation helpful? Give feedback.
All reactions