Skip to content

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

Description

@BillyRayPreachersSon

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) {
  ...
})

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions