MCPcopy
hub / github.com/socketio/socket.io / onack

Method onack

packages/socket.io-client/lib/socket.ts:808–822  ·  view source on GitHub ↗

* Called upon a server acknowledgement. * * @param packet * @private

(packet: Packet)

Source from the content-addressed store, hash-verified

806 * @private
807 */
808 private onack(packet: Packet): void {
809 const ack = this.acks[packet.id];
810 if (typeof ack !== "function") {
811 debug("bad ack %s", packet.id);
812 return;
813 }
814 delete this.acks[packet.id];
815 debug("calling ack %s with %j", packet.id, packet.data);
816 // @ts-ignore FIXME ack is incorrectly inferred as 'never'
817 if (ack.withError) {
818 packet.data.unshift(null);
819 }
820 // @ts-ignore
821 ack.apply(this, packet.data);
822 }
823
824 /**
825 * Called upon server connect.

Callers 1

onpacketMethod · 0.95

Calls 2

debugFunction · 0.85
applyMethod · 0.80

Tested by

no test coverage detected