Skip to content

Commit

Permalink
Merge pull request #68 from esp/devToolsUpdate
Browse files Browse the repository at this point in the history
0.5.16
  • Loading branch information
KeithWoods committed Feb 20, 2016
2 parents 543b3ad + 5f03767 commit eb21221
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "esp-js",
"version": "0.5.15",
"version": "0.5.16",
"description": "Evented State Processor (ESP) adds specific processing workflow around changes to a model's state",
"keywords": [
"state processor",
Expand Down
1 change: 1 addition & 0 deletions src/router/Router.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export default class Router extends DisposableBase {
Guard.isString(modelId, 'The modelId argument should be a string');
let modelRecord = this._models[modelId];
if(modelRecord){
this._diagnosticMonitor.removeModel(modelId);
modelRecord.wasRemoved = true;
delete this._models[modelId];
modelRecord.eventQueue.length = 0;
Expand Down
4 changes: 4 additions & 0 deletions src/router/devtools/compositeDiagnosticMonitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ export default class CompositeDiagnosticMonitor extends DisposableBase {
this._currentLoggingDiagnosticMonitor.addModel(modelId);
this._devToolsDiagnostic.addModel(modelId);
}
removeModel(modelId){
this._currentLoggingDiagnosticMonitor.removeModel(modelId);
this._devToolsDiagnostic.removeModel(modelId);
}
publishEvent(modelId, eventType, event) {
this._currentLoggingDiagnosticMonitor.publishEvent(modelId, eventType);
this._devToolsDiagnostic.publishEvent(modelId, eventType, event);
Expand Down
5 changes: 5 additions & 0 deletions src/router/devtools/devToolsDiagnosticMonitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ export default class DevToolsDiagnosticMonitor extends DisposableBase {
window.__espAnalyticsMonitor.addModel(modelId);
}
}
removeModel(modelId){
if(this._ensureDiagnosticEnabled()) {
window.__espAnalyticsMonitor.removeModel(modelId);
}
}
publishEvent(modelId, eventType, event) {
if(this._ensureDiagnosticEnabled()) {
window.__espAnalyticsMonitor.publishEvent(modelId, eventType, event);
Expand Down
2 changes: 2 additions & 0 deletions src/router/devtools/loggingDiagnosticMonitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ export default class LoggingDiagnosticMonitor {
}
addModel(modelId){
}
removeModel(modelId){
}
publishEvent(modelId, eventType) {
this._pushStep(`[PublishEvent]:${modelId}:${eventType}`);
}
Expand Down
2 changes: 2 additions & 0 deletions src/router/devtools/noopDiagnosticMonitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
export default class NoopDiagnosticMonitor {
addModel(){
}
removeModel(){
}
getSummary() {
return 'Call router.enableDiagnostics() to enable diagnostics. If in a browser use esp-js-devtools.';
}
Expand Down

0 comments on commit eb21221

Please sign in to comment.