Created
May 11, 2018 14:30
-
-
Save mmintel/541565d43bb394a26bca908b555ab1c3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| 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