Skip to content

Instantly share code, notes, and snippets.

@mmintel
Created May 11, 2018 14:30
Show Gist options
  • Select an option

  • Save mmintel/541565d43bb394a26bca908b555ab1c3 to your computer and use it in GitHub Desktop.

Select an option

Save mmintel/541565d43bb394a26bca908b555ab1c3 to your computer and use it in GitHub Desktop.
import Model from './model';
export default class ModalModel extends Model {
constructor() {
super();
// Modal offen, oder nicht?
this._isOpen = false;
}
// Erhalte den aktuellen Status
get isOpen() {
return this._isOpen;
}
// Setze einen neuen Status und informiere alle Beobachter.
set isOpen(value) {
this._isOpen = !!value;
this.notifyAll();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment