Skip to content

BKUMAR-RASU/ember-did-change-attrs

 
 

Repository files navigation

ember-did-change-attrs Build Status

This addon is a WIP rethink of ember-diff-attrs which offered a decorator style approach to this problem.

With ember-did-change-attrs we're going to solve the same problem using mixins instead of functions. The aim is to offer a simpler API which covers attribute change use cases that previously might have been solved using the now deprecated didReceiveAttrs and didUpdateAttrs arguments.

This API is still experimental, suggestions for improvements are encouraged and very much appreciated.

Installation

ember install ember-did-change-attrs

Usage

import DidChangeAttrs from 'ember-did-change-attrs';

export default Ember.Component.extend(DidChangeAttrs, {
  didChangeAttrsConfig: {
    attrs: ['email']
  },

  didChangeAttrs(changes) {
    this._super(...arguments);

    if(changes.email) {
      let oldEmail = changes.email.previous,
          newEmail = changes.email.current;
      // Do stuff
    }
  }
});

ember-did-change-attrs

[Short description of the addon.]

Compatibility

  • Ember.js v3.24 or above
  • Ember CLI v3.24 or above
  • Node.js v12 or above

Installation

ember install ember-did-change-attrs

Usage

[Longer description of how to use the addon in apps.]

Contributing

See the Contributing guide for details.

License

This project is licensed under the MIT License.

About

ember did chagne attrs addon

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • JavaScript 85.9%
  • HTML 13.6%
  • Handlebars 0.5%