History

class Router extends Events

Simon Legner committed 2 years ago

Commit da10e5c1 parent f839ec51 file · +2 −3Browse files

Unified · Split

assets/javascripts/app/router.js+2−3
@@ -9,10 +9,8 @@ · 8 unmodified lines
99 * DS207: Consider shorter variations of null checks
1010 * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
1111 */
12−app.Router = class Router {
12+app.Router = class Router extends Events {
1313 static initClass() {
14− $.extend(this.prototype, Events);
15−
1614 this.routes = [
1715 ["*", "before"],
1816 ["/", "root"],
@@ -29,6 +27,7 @@ app.Router = class Router { · 10 unmodified lines
2927 }
3028
3129 constructor() {
30+ super();
3231 for (var [path, method] of Array.from(this.constructor.routes)) {
3332 page(path, this[method].bind(this));
3433 }