-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature request] Allow setting multiple keys #9
Comments
Can you provide an example of the API that you're thinking about? Definitely interested, but I'm not sure what the ergonomics would be like. |
@pzuraq - well, I haven't really thought about it, but I would guess something like: <button {{on "click" (set-properties (array (key=this.greeting value="Hello!") (key=this.other value="bar!")))}}> Or something. Another way would be to create a "chain" helper that would allow you to: <button {{on "click" (chain (set this.greeting "Hello!") (set this.other "bar!"))}}> Although this is not exactly the same because it will call I guess there could be other ways of implementing this as well. |
That https://github.com/DockYard/ember-composable-helpers#queue You should able to do this: <button {{on "click" (queue (set this.greeting "Hello!") (set this.other "bar!"))}}> Or even this <input {{on "input" (queue (set this.greeting (get _ 'target.value')) (set this.other (get _ 'target.value')))}}> |
@alexlafroscia - true, but there's two issues with that - 1) I have to install yet another addon; 2) the problem that I've mentioned in my previous comment - |
I believe FWIW, I'm about to merge a refactor to replace the main API here with the one from That said, I'm still open to adding something like this, but would need to think on the API a bit more to see if it would be worth it from an ergonomics perspective. |
We have a few actions in our codebase that do only a
setProperties
call which could use thatset
helper but it accepts only one key and value. Perhaps another helper for multiple ones could be written? Or the same one to be extended to allow multiple keys?The text was updated successfully, but these errors were encountered: