Removed EventEmitter inheritance in frontend routers

refs https://linear.app/tryghost/issue/CORE-104/decouple-frontend-routing-events-from-urlserver-events

- Now that routers don't emit any events there's no need to extend EventEmitter in the router's base class
- Less inheritance the lighter the runtime and the cleaner the code!
This commit is contained in:
Naz 2021-10-18 16:23:06 +04:00 committed by naz
parent 18344a16e2
commit 048b1102ad

View File

@ -9,7 +9,6 @@
const debug = require('@tryghost/debug')('routing:parent-router');
const EventEmitter = require('events').EventEmitter;
const express = require('../../../shared/express');
const _ = require('lodash');
const url = require('url');
@ -46,10 +45,8 @@ function GhostRouter(options) {
return innerRouter;
}
class ParentRouter extends EventEmitter {
class ParentRouter {
constructor(name) {
super();
this.identifier = security.identifier.uid(10);
this.name = name;