Skip to content

Instantly share code, notes, and snippets.

@basz
Created January 17, 2019 11:21
Show Gist options
  • Save basz/41dce162d4567170d0ca04a556e4a5e3 to your computer and use it in GitHub Desktop.
Save basz/41dce162d4567170d0ca04a556e4a5e3 to your computer and use it in GitHub Desktop.
addedElements: computed('elements.[]', function() {
const elements = this.get('elements');
const newElements = elements.filter(element => !this.get('prevElements').includes(element));
this.set('prevElements', elements.copy()); // this is *bad*
return newElements;
}),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment