Skip to content

Instantly share code, notes, and snippets.

@goofmint
Created August 22, 2017 07:23
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/4391e8142acbefb38814e4f047477ee4 to your computer and use it in GitHub Desktop.
Save goofmint/4391e8142acbefb38814e4f047477ee4 to your computer and use it in GitHub Desktop.
function ObservableArray() {
this.name = 'Init';
};
ObservableArray.prototype.updateName = 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