Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jasongorman
Created April 28, 2019 08:24
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 jasongorman/9d9070d741dd32621adf8bc5d532c53c to your computer and use it in GitHub Desktop.
Save jasongorman/9d9070d741dd32621adf8bc5d532c53c to your computer and use it in GitHub Desktop.
function Observable(){
this.observers = [];
this.notify = () => {
for (var observer of this.observers) {
observer.update();
}
}
this.addObserver = (observer) => {
this.observers.push(observer);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment