{"action":"opened","issue":{"url":"https://api.github.com/repos/wycats/handlebars.js/issues/1050","labels_url":"https://api.github.com/repos/wycats/handlebars.js/issues/1050/labels{/name}","comments_url":"https://api.github.com/repos/wycats/handlebars.js/issues/1050/comments","events_url":"https://api.github.com/repos/wycats/handlebars.js/issues/1050/events","html_url":"https://github.com/wycats/handlebars.js/issues/1050","id":92211672,"number":1050,"title":"Splat operator","user":{"login":"mixonic","id":8752,"avatar_url":"https://avatars.githubusercontent.com/u/8752?v=3","gravatar_id":"","url":"https://api.github.com/users/mixonic","html_url":"https://github.com/mixonic","followers_url":"https://api.github.com/users/mixonic/followers","following_url":"https://api.github.com/users/mixonic/following{/other_user}","gists_url":"https://api.github.com/users/mixonic/gists{/gist_id}","starred_url":"https://api.github.com/users/mixonic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mixonic/subscriptions","organizations_url":"https://api.github.com/users/mixonic/orgs","repos_url":"https://api.github.com/users/mixonic/repos","events_url":"https://api.github.com/users/mixonic/events{/privacy}","received_events_url":"https://api.github.com/users/mixonic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-30T22:04:00Z","updated_at":"2015-06-30T22:04:00Z","closed_at":null,"body":"I've been fielding several requests for a splat operator in Ember templates. Specifically, when using Ember components. For example given:\r\n\r\n```handlebars\r\n{{! presuming myHash === { keyA: 'val', keyB: context.someProp } }}\r\n{{my-component *myHash}}\r\n```\r\n\r\nIt would de-sugar to:\r\n\r\n```handlebars\r\n{{my-component keyA=\"val\" keyB=someProp}}\r\n```\r\n\r\nThis proposal is limited in scope.\r\n\r\n* It does not propose a way to de-sugar params from an array, only properties from an object into the hash. I find it useful to consider the params case in designing this API though, presuming that it would use the same syntax but simply vary behavior at runtime based on the contents of the splatted variable.\r\n* I propose that only a single splat be allowed.\r\n\r\n**Grammer proposal**\r\n\r\n```\r\nOPEN helperName param* hashSplat? hash? CLOSE\r\n```\r\n\r\nVisually, it makes sense to put the splat before any hash arguments. This would aid in the understanding that hash arguments should take precedence. For example given:\r\n\r\n```handlebars\r\n{{! presuming myHash === { keyA: 'val', keyB: context.someProp } }}\r\n{{my-component someParam *myHash keyB=\"I take the crown!\"}}\r\n```\r\n\r\nThe hash would be `{ keyA: 'val', keyB: 'I take the crown!' }`. This is actually runtime behavior, and could vary according to implementation, but seems a good justification for the above ordering.\r\n\r\nIt is also suggested that subexpressions would also accept a splat. For example:\r\n\r\n```handlebars\r\n{{my-component someParam=(translate *translateOptions)}}\r\n```\r\n\r\n**Alternatives**\r\n\r\nIt has been suggested by @wycats that we consider `...myHash`, as it aligns more closely with JavaScript splatting. This seems reasonable, I'd like some more thoughts.\r\n\r\n/cc @kpdecker @mmun @krisselden @wycats @chrislopresto"}}