Skip to content

Instantly share code, notes, and snippets.

@joegaudet
Created November 10, 2017 19:36
Show Gist options
  • Save joegaudet/f1cc4cb5e7b3935d7348d115771fd8a1 to your computer and use it in GitHub Desktop.
Save joegaudet/f1cc4cb5e7b3935d7348d115771fd8a1 to your computer and use it in GitHub Desktop.
const Foo = Ember.Object.extend({
// this is being placed on the Foo prototype
// and will be shared between all instances of foo
someData: []
});
const aFoo = Foo.create({});
const anotherFoo = Foo.create({});
aFoo.get('someData').push(1);
anotherFoo.get('someData').push(2);
aFoo.get('someData'); // [1, 2]
anotherFoo.get('someData'); // [1, 2]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment