Можно
function MinesweeperModel() {}
MinesweeperModel.EVENT_UPDATE = 'update';
MinesweeperModel.prototype._handlers = {};
MinesweeperModel.prototype.subscribe = function (type, handler) {
var handlers = this._handlers;
if (!handlers[type]) handlers[type] = [];
handlers[type].push(handler);
};
MinesweeperModel.prototype.unsubscribe = function (type, handler) {
var handlers = this._handlers[type], i = handlers.indexOf(handler);
if (i > -1) handlers.splice(i, 1);
};
MinesweeperModel.prototype.dispatch = function (type, data) {
var handlers = this._handlers[type], i = 0;
while (i < handlers.length) handlers[i++].call(this, data);
};
function DomView() {}
DomView.prototype.redraw = function () {
alert('redraw');
};
DomView.prototype.attach = function (model) {
this.model = model;
var that = this; // чтобы this был доступен в функции
this.model.subscribe(MinesweeperModel.EVENT_UPDATE, function (e) {
that.redraw(); // перерисовать картинку
});
};
var model = new MinesweeperModel();
var view = new DomView();
view.attach(model);
model.dispatch('update');