{"action":"created","issue":{"url":"https://api.github.com/repos/emberjs/rfcs/issues/184","repository_url":"https://api.github.com/repos/emberjs/rfcs","labels_url":"https://api.github.com/repos/emberjs/rfcs/issues/184/labels{/name}","comments_url":"https://api.github.com/repos/emberjs/rfcs/issues/184/comments","events_url":"https://api.github.com/repos/emberjs/rfcs/issues/184/events","html_url":"https://github.com/emberjs/rfcs/issues/184","id":192914843,"number":184,"title":"Spread Operator In Templates","user":{"login":"migeorge","id":1667251,"avatar_url":"https://avatars.githubusercontent.com/u/1667251?v=3","gravatar_id":"","url":"https://api.github.com/users/migeorge","html_url":"https://github.com/migeorge","followers_url":"https://api.github.com/users/migeorge/followers","following_url":"https://api.github.com/users/migeorge/following{/other_user}","gists_url":"https://api.github.com/users/migeorge/gists{/gist_id}","starred_url":"https://api.github.com/users/migeorge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/migeorge/subscriptions","organizations_url":"https://api.github.com/users/migeorge/orgs","repos_url":"https://api.github.com/users/migeorge/repos","events_url":"https://api.github.com/users/migeorge/events{/privacy}","received_events_url":"https://api.github.com/users/migeorge/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-01T17:43:03Z","updated_at":"2016-12-01T20:15:51Z","closed_at":null,"body":"## Problem\r\n\r\nCurrently there is no way to pass dynamic parameters to certain Template Helpers. I'll call out the `query-params` helper in this case as an example.\r\n\r\nTypically we'd use it in the following way:\r\n```\r\n{{#link-to 'route' (query-params sort=\"asc\" status=\"complete\")}}\r\n```\r\nWhich would give us a link to `/route?sort=asc&status=complete`\r\n\r\nThis works well, but there is no way to pass a set of dynamic values to the helper. If we have the following in a component: \r\n```\r\nparams: {\r\n  sort: 'asc',\r\n  status: 'complete'\r\n}\r\n```\r\nYou can't destructure the parameters in the template:\r\n```\r\n{{#link-to 'route' (query-params params)}}\r\n```\r\n\r\n## Solution\r\nWe should add support for a spread operator (similar to the one in javascript) for use in templates.\r\nI would see something like this looking like:\r\n```\r\n{{#link-to 'route (query-params ...params)}}\r\n```\r\nWhich would end up being the same as:\r\n```\r\n{{#link-to 'route' (query-params sort=\"asc\" status=\"complete\")}}\r\n```\r\nBut would allow us to change `params` and have it reflect in the helper."},"comment":{"url":"https://api.github.com/repos/emberjs/rfcs/issues/comments/264282033","html_url":"https://github.com/emberjs/rfcs/issues/184#issuecomment-264282033","issue_url":"https://api.github.com/repos/emberjs/rfcs/issues/184","id":264282033,"user":{"login":"workmanw","id":825487,"avatar_url":"https://avatars.githubusercontent.com/u/825487?v=3","gravatar_id":"","url":"https://api.github.com/users/workmanw","html_url":"https://github.com/workmanw","followers_url":"https://api.github.com/users/workmanw/followers","following_url":"https://api.github.com/users/workmanw/following{/other_user}","gists_url":"https://api.github.com/users/workmanw/gists{/gist_id}","starred_url":"https://api.github.com/users/workmanw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/workmanw/subscriptions","organizations_url":"https://api.github.com/users/workmanw/orgs","repos_url":"https://api.github.com/users/workmanw/repos","events_url":"https://api.github.com/users/workmanw/events{/privacy}","received_events_url":"https://api.github.com/users/workmanw/received_events","type":"User","site_admin":false},"created_at":"2016-12-01T20:15:51Z","updated_at":"2016-12-01T20:15:51Z","body":"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 https://github.com/wycats/handlebars.js/pull/1149. In theory it should be compatible with the `query-params` helper.\r\n\r\nA 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: \r\n\r\n```javascript\r\n{{#each dynamicComponents as |compInfo|}}\r\n  {{component compInfo.class ...compInfo.args}}\r\n{{/each}}\r\n```"}}
{"actor":{"display_login":"workmanw"}}