We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Current way to merge an object:
{{#each-in (from-entries (append (entries foo) (entries bar))) as |key value|}} {{key}}:{{value}} {{/each}}
If this is also used with (hash) it will make for quite the complex setup:
(hash)
{{#each-in (from-entries (append (entries (hash foo="FOO")) (entries (hash bar="BAR")) ) ) as |key value| }} {{key}}:{{value}} {{/each}}
An alternative could use Object.assign instead:
Object.assign
{{#each-in (assign (hash foo="FOO") (hash bar="BAR")) as |key value|}} {{key}}:{{value}} {{/each}}
Possible implementation:
import { helper } from '@ember/component/helper'; export function assign(objects: (Record<string, unknown> | null | undefined)[]) { return Object.assign({}, ...objects); } export default helper(assign);
The text was updated successfully, but these errors were encountered:
Why not use Object.assign directly?
https://limber.glimdown.com/edit?c=PTAEGUFNNALAXeAHAzgLhAcwJb1gVwCMA6AYwHsBbYSSwyAJwCsVgGAzU1pfAG1%2BABGAAwB2YQChekeKADeoAFLgA8gDkANKBWEmkUvDTbdoAL6gAvKEy9yhAIa8AKrGwoA3BIkUAdiln2lvKg9kaCZp6%2B-qCEQQqERgBMEV4APPC0SLz2GQB8EqCgqUgMkLlycsrqxP4M2D447ACeoAAUOkzE9igo2Jg%2BITEAlKA%2BfLygAMympqnAJWUScxmUWTllQA&format=gjs
Sorry, something went wrong.
No branches or pull requests
Current way to merge an object:
If this is also used with
(hash)
it will make for quite the complex setup:An alternative could use
Object.assign
instead:Possible implementation:
The text was updated successfully, but these errors were encountered: