Last change
on this file since 571e0df was e29cc2e, checked in by Ema <ema_spirova@…>, 3 years ago |
primeNG components
|
-
Property mode
set to
100644
|
File size:
1.3 KB
|
Rev | Line | |
---|
[6a3a178] | 1 | "use strict";
|
---|
| 2 | Object.defineProperty(exports, "__esModule", { value: true });
|
---|
| 3 | exports.ParentNamespace = void 0;
|
---|
| 4 | const namespace_1 = require("./namespace");
|
---|
| 5 | class ParentNamespace extends namespace_1.Namespace {
|
---|
| 6 | constructor(server) {
|
---|
| 7 | super(server, "/_" + ParentNamespace.count++);
|
---|
| 8 | this.children = new Set();
|
---|
| 9 | }
|
---|
| 10 | /**
|
---|
| 11 | * @private
|
---|
| 12 | */
|
---|
| 13 | _initAdapter() {
|
---|
[e29cc2e] | 14 | const broadcast = (packet, opts) => {
|
---|
| 15 | this.children.forEach((nsp) => {
|
---|
| 16 | nsp.adapter.broadcast(packet, opts);
|
---|
| 17 | });
|
---|
| 18 | };
|
---|
| 19 | // @ts-ignore FIXME is there a way to declare an inner class in TypeScript?
|
---|
| 20 | this.adapter = { broadcast };
|
---|
[6a3a178] | 21 | }
|
---|
| 22 | emit(ev, ...args) {
|
---|
| 23 | this.children.forEach((nsp) => {
|
---|
| 24 | nsp.emit(ev, ...args);
|
---|
| 25 | });
|
---|
| 26 | return true;
|
---|
| 27 | }
|
---|
| 28 | createChild(name) {
|
---|
| 29 | const namespace = new namespace_1.Namespace(this.server, name);
|
---|
| 30 | namespace._fns = this._fns.slice(0);
|
---|
| 31 | this.listeners("connect").forEach((listener) => namespace.on("connect", listener));
|
---|
| 32 | this.listeners("connection").forEach((listener) => namespace.on("connection", listener));
|
---|
| 33 | this.children.add(namespace);
|
---|
| 34 | this.server._nsps.set(name, namespace);
|
---|
| 35 | return namespace;
|
---|
| 36 | }
|
---|
| 37 | }
|
---|
| 38 | exports.ParentNamespace = ParentNamespace;
|
---|
| 39 | ParentNamespace.count = 0;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.