Skip to content
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

Allow diffAttrs to use brace expansion (includes PR) #35

Open
BillyRayPreachersSon opened this issue Jan 11, 2022 · 1 comment
Open

Comments

@BillyRayPreachersSon
Copy link

I wasn't sure if I had to raise an issue to match my PR, so apologies if this is an unnecessary step.

Brace expansion will be familiar to anyone who has worked with Ember's computed properties, and it's something I've been wanting to use with ember-diff-attrs for a while.

It's currently unsupported, but I've raised PR #34 to allow it to work.

For those unfamiliar with brace exapansion, it allows developers to specify related property names grouped together in curly braces, to avoid having to specify the parent path multiple times.

Before:

didReceiveAttrs: diffAttrs('user.forename', 'user.age', 'admin.surname', 'admin.email', 'admin.age', function(changedAttrs) {
  ...
})

After:

didReceiveAttrs: diffAttrs('user.{forename,age}', 'admin.{surname,email,age}', function(changedAttrs) {
  ...
})
@BillyRayPreachersSon BillyRayPreachersSon changed the title diffAttrs does not support brace expansion Allow diffAttrs to use brace expansion (includes PR) Feb 22, 2022
@BillyRayPreachersSon
Copy link
Author

@workmanw Would you be OK to merge the PR behind this (#34)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant