Created
April 28, 2019 08:24
-
-
Save jasongorman/9d9070d741dd32621adf8bc5d532c53c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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