You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current (iter) API is built upon immediately invoked functions, i.e. lerna-script-magicz()returns a function that then can be called immediately.
What is the motivation for this pattern? I've never seen it in the wild (apart from IIFEs which serve a totally different use case), the closest you would get to is Reacts Hook Pattern and there they are almost exclusively never immediately invoke the function but assign to a variable and call it.
Looking at the code, I can see that it might simplify development but at the sacrifice of a bad API.
The iter stuff is sync, so it should either be possible to call it in a sync way iter.parallel(packages, packageFn)or use a fluent API such as iter.parallel(packages).with(packageFn).
Another possibility would be returning proxied arrays, which would also be feasible with lerna running on node.
The current (iter) API is built upon immediately invoked functions, i.e.
lerna-script-magicz()
returns a function that then can be called immediately.What is the motivation for this pattern? I've never seen it in the wild (apart from IIFEs which serve a totally different use case), the closest you would get to is Reacts Hook Pattern and there they are almost exclusively never immediately invoke the function but assign to a variable and call it.
Looking at the code, I can see that it might simplify development but at the sacrifice of a bad API.
The
iter
stuff is sync, so it should either be possible to call it in a sync wayiter.parallel(packages, packageFn)
or use a fluent API such asiter.parallel(packages).with(packageFn)
.Another possibility would be returning proxied arrays, which would also be feasible with
lerna
running on node.Using the pattern
you could support this syntax without breaking the existing API too much at the benefit of a more natural API.
The text was updated successfully, but these errors were encountered: