SocketIORouter: Add ability to unregister handler
This will make it easier to add tests.pull/5171/head
parent
2e93fca699
commit
94f71bd5e9
|
@ -39,11 +39,13 @@ let io;
|
|||
* adds a component
|
||||
*/
|
||||
exports.addComponent = (moduleName, module) => {
|
||||
// save the component
|
||||
if (module == null) return exports.deleteComponent(moduleName);
|
||||
components[moduleName] = module;
|
||||
module.setSocketIO(io);
|
||||
};
|
||||
|
||||
exports.deleteComponent = (moduleName) => { delete components[moduleName]; };
|
||||
|
||||
/**
|
||||
* sets the socket.io and adds event functions for routing
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue