refactoring: implement actionmanager, and router

So we now have a working SPA!
This commit is contained in:
Géry Debongnie
2019-01-24 10:58:46 +01:00
parent 443f5e210c
commit c6b83b1aed
10 changed files with 193 additions and 144 deletions
+10
View File
@@ -10,6 +10,16 @@ describe("event bus behaviour", () => {
expect(notified).toBe(true);
});
test("callbacks are called with proper 'this'", () => {
expect.assertions(1);
const bus = new Bus();
const owner = {};
bus.on("event", owner, function(this: any) {
expect(this).toBe(owner);
});
bus.trigger("event");
});
test("can unsubscribe", () => {
const bus = new Bus();
let notified = false;