Last active
June 2, 2016 13:59
-
-
Save antonmedv/39bfa4880ab34907ff00e78517ef1830 to your computer and use it in GitHub Desktop.
Monkberry v4
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 AppView from './AppView.monk'; | |
export class App extends AppView { | |
construction() { | |
this.state = {...}; | |
} | |
update(data) { | |
// Do something... | |
Object.assign(this.state, data); | |
// Update view. | |
super.update(data); | |
// Do something more... | |
} | |
} |
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 AppView from './AppView.monk'; | |
const view = new AppView(); | |
view.appendTo(document.body); | |
// ... | |
view.update(data); | |
AppView.prerender(10); |
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 Monkberry from 'monkberry'; | |
import AppView from './AppView.monk'; | |
const monkberry = new Monkberry(); | |
const view = monkberry.render(AppView); | |
view.appendTo(document.body); | |
// ... | |
view.update(data); | |
monkberry.prerender(AppView, 10); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment