'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.invalidateSimulation = invalidateSimulation;
exports.onSimulationChange = onSimulationChange;
exports.invalidateProject = invalidateProject;
exports.onProjectChange = onProjectChange;
var _monologue = require('monologue.js');
var _monologue2 = _interopRequireDefault(_monologue);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { Iif (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var Observable = function Observable() {
_classCallCheck(this, Observable);
};
_monologue2.default.mixInto(Observable);
var notification = new Observable();
var SIMULATION_CHANGE = 'data.simulation.change';
var PROJECT_CHANGE = 'data.project.change';
function invalidateSimulation(simulation) {
notification.emit(SIMULATION_CHANGE, simulation);
}
function onSimulationChange(cb) {
return notification.on(SIMULATION_CHANGE, cb);
}
function invalidateProject(project) {
notification.emit(PROJECT_CHANGE, project);
}
function onProjectChange(cb) {
return notification.on(PROJECT_CHANGE, cb);
}
|