Dataspace.setOnStateChange, to correctly call it at least once
This commit is contained in:
parent
7c4e00f614
commit
abc844c964
|
@ -51,9 +51,9 @@ $(document).ready(function () {
|
|||
});
|
||||
});
|
||||
|
||||
G.dataspace.onStateChange = function (mux, patch) {
|
||||
G.dataspace.setOnStateChange(function (mux, patch) {
|
||||
$("#spy-holder").text(Syndicate.prettyTrie(mux.routingTable));
|
||||
};
|
||||
});
|
||||
|
||||
G.startStepping();
|
||||
});
|
||||
|
|
|
@ -192,7 +192,7 @@ $(document).ready(function () {
|
|||
spawnChaosMonkey();
|
||||
}
|
||||
|
||||
G.dataspace.onStateChange = function (mux, patch) {
|
||||
G.dataspace.setOnStateChange(function (mux, patch) {
|
||||
$("#ds-state").text(Syndicate.prettyTrie(mux.routingTable));
|
||||
};
|
||||
});
|
||||
});
|
||||
|
|
|
@ -27,8 +27,8 @@ $(document).ready(function () {
|
|||
}
|
||||
});
|
||||
});
|
||||
G.dataspace.onStateChange = function (mux, patch) {
|
||||
G.dataspace.setOnStateChange(function (mux, patch) {
|
||||
$("#spy-holder").text(Syndicate.prettyTrie(mux.routingTable));
|
||||
};
|
||||
});
|
||||
G.startStepping();
|
||||
});
|
||||
|
|
|
@ -163,7 +163,7 @@ $(document).ready(function () {
|
|||
spawnSearch();
|
||||
}
|
||||
|
||||
G.dataspace.onStateChange = function (mux, patch) {
|
||||
G.dataspace.setOnStateChange(function (mux, patch) {
|
||||
$("#spy-holder").text(Syndicate.prettyTrie(mux.routingTable));
|
||||
};
|
||||
});
|
||||
});
|
||||
|
|
|
@ -203,9 +203,9 @@ $(document).ready(function () {
|
|||
spawnSearch();
|
||||
});
|
||||
|
||||
G.dataspace.onStateChange = function (mux, patch) {
|
||||
G.dataspace.setOnStateChange(function (mux, patch) {
|
||||
$("#spy-holder").text(Syndicate.prettyTrie(mux.routingTable));
|
||||
};
|
||||
});
|
||||
|
||||
G.startStepping();
|
||||
});
|
||||
|
|
|
@ -287,6 +287,11 @@ Dataspace.prototype.deliverEvent = function (pid, event) {
|
|||
if (childBusy) this.markRunnable(pid);
|
||||
};
|
||||
|
||||
Dataspace.prototype.setOnStateChange = function (handler) {
|
||||
this.onStateChange = handler;
|
||||
this.onStateChange(this.mux, Patch.emptyPatch);
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
module.exports.stateChange = stateChange;
|
||||
|
|
Loading…
Reference in New Issue