Skip to content

Instantly share code, notes, and snippets.

@goofmint
Created August 22, 2017 07:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goofmint/17afca8a826537a387fa28a91319fb12 to your computer and use it in GitHub Desktop.
Save goofmint/17afca8a826537a387fa28a91319fb12 to your computer and use it in GitHub Desktop.
function ObservableArray() {
this.name = 'Init';
};
ObservableArray.prototype.nameChange = function(name) {
this.dispatchEvent({
type: 'changeBefore',
data: this,
});
this.name = name;
this.dispatchEvent({
type: 'change',
data: this,
});
}
h5.mixin.eventDispatcher.mix(ObservableArray.prototype);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment