Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * A 1-way View Module
- */
- var simpleMVC = (function simpleMVC(simple) {
- 'use strict';
- simple.OneWayView = function simpleOneWayView(model, selector) {
- this._model = model;
- this._selector = selector;
- // since not a 2-way, don't need to set this.onChanged
- // attach model listeners
- this._model.onSet.attach(
- () => this.show()
- );
- };
- simple.OneWayView.prototype = {
- show() {
- this._selector.innerHTML = this._model.get();
- },
- };
- return simple;
- })(simpleMVC || {});
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement