refactor: forego namespace
This commit is contained in:
parent
0fdff9b33c
commit
7226ca8979
|
@ -7,7 +7,6 @@ export class Packet {
|
|||
static get schema() {
|
||||
return {
|
||||
_id: 'uint8',
|
||||
nsp: 'string',
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -52,7 +52,6 @@ class Encoder {
|
|||
return schema.encode({
|
||||
_id: eventId,
|
||||
data: packet.data[1],
|
||||
nsp: packet.nsp,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -84,12 +83,12 @@ class Decoder extends decorateDecoder(class {}) {
|
|||
if (!schema) {
|
||||
throw new Error(`unknown schema with id: ${packetId}`);
|
||||
}
|
||||
const {data, nsp} = schema.decode(obj);
|
||||
const {data} = schema.decode(obj);
|
||||
const Packet = packetFromId(packetId);
|
||||
packet = {
|
||||
type: TYPES.EVENT,
|
||||
data: [packetId, new Packet(data)],
|
||||
nsp,
|
||||
nsp: '/',
|
||||
};
|
||||
}
|
||||
catch (e) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user