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
I've been hoping we would see a spread or splat operator for a long time. There is actually an open PR in the handlebars repo handlebars-lang/handlebars.js#1149. In theory it should be compatible with the query-params helper.
A really huge use case is being able to use the component helper in a much more dynamic way. We lost this ability when Ember.ContainerView was removed and haven't fully got it back. Eg:
Another solution is to make this work: {{#link-to 'route' (query-params params)}} The (query-params) helper could accept the first positional param as the hash;
@workmanw I'll keep an eye on that PR, we might just have to wait until that lands in handlebars. I agree that it would be great to be able dynamically insert components too!
@Panman8201 For my use case modifying the query-params helper directly would solve my problem and may be a good short term fix, but I think the spread operator would be a much more powerful addition.
Another plus side for being able to splat arguments and similar is that it makes one variant of higher-order components quite nice: you can just wrap an existing component, make some template-layer tweaks/wrapping and forward all the inbound arguments to it.
I have the same use case as @workmanw@amk221 and @basz and I totally agree with @chriskrycho : a spread operator would be the best friend of the {{component}} helper 🙂
@chriskrycho Sorry to bother you about this old one, but do you know what is the status of this ? I mean, I've searched a bit, but I can't find if today we can splat arguments, passing them to the {{component}} helper?
Activity
workmanw commentedon Dec 1, 2016
I've been hoping we would see a spread or splat operator for a long time. There is actually an open PR in the handlebars repo handlebars-lang/handlebars.js#1149. In theory it should be compatible with the
query-paramshelper.A really huge use case is being able to use the component helper in a much more dynamic way. We lost this ability when
Ember.ContainerViewwas removed and haven't fully got it back. Eg:Panman82 commentedon Dec 1, 2016
Another solution is to make this work:
{{#link-to 'route' (query-params params)}}The(query-params)helper could accept the first positional param as the hash;Of course this only addresses the query params problem and not other uses cases...
migeorge commentedon Dec 1, 2016
@workmanw I'll keep an eye on that PR, we might just have to wait until that lands in handlebars. I agree that it would be great to be able dynamically insert components too!
migeorge commentedon Dec 1, 2016
@Panman8201 For my use case modifying the
query-paramshelper directly would solve my problem and may be a good short term fix, but I think the spread operator would be a much more powerful addition.amk221 commentedon Aug 27, 2019
My use case is:
buschtoens commentedon Aug 28, 2019
@amk221 You could use @tchak's
ember-merge-helper:One issue with above helper (AFAICT) is that it does not track changes on
moreThings, as this is the full implementation:tchak commentedon Aug 28, 2019
The reason I created
ember-merge-helperis exactly to solvelink-to/query-paramsproblem :)basz commentedon Sep 15, 2019
My use case would be:
chriskrycho commentedon Sep 16, 2019
Another plus side for being able to splat arguments and similar is that it makes one variant of higher-order components quite nice: you can just wrap an existing component, make some template-layer tweaks/wrapping and forward all the inbound arguments to it.
algodave commentedon May 9, 2021
I have the same use case as @workmanw @amk221 and @basz and I totally agree with @chriskrycho : a spread operator would be the best friend of the
{{component}}helper 🙂sly7-7 commentedon Apr 21, 2022
@chriskrycho Sorry to bother you about this old one, but do you know what is the status of this ? I mean, I've searched a bit, but I can't find if today we can splat arguments, passing them to the
{{component}}helper?wagenet commentedon Jul 23, 2022
This seems like a good idea, but we need an RFC to move it forward. Is there anything I can do to help facilitate?
NullVoxPopuli commentedon Nov 20, 2024
idea: #593 (comment)