Damien Arrachequesne 59023657a0 feat: add support for typed events
Syntax:

```ts
interface ServerToClientEvents {
  "my-event": (a: number, b: string, c: number[]) => void;
}

interface ClientToServerEvents {
  hello: (message: string) => void;
}

const socket: Socket<ServerToClientEvents, ClientToServerEvents> = io();

socket.emit("hello", "world");

socket.on("my-event", (a, b, c) => {
  // ...
});
```

The events are not typed by default (inferred as any), so this change
is backward compatible.

Related: https://github.com/socketio/socket.io/issues/3742
2021-03-10 01:24:56 +01:00
2021-02-26 01:10:30 +01:00
2021-01-08 15:13:43 +01:00
2021-03-10 01:24:56 +01:00
2021-03-10 01:24:56 +01:00
2020-10-13 23:35:22 +02:00
2021-02-26 01:10:30 +01:00
2014-07-25 08:02:12 -06:00

socket.io-client

Build Status Dependency Status devDependency Status NPM version Downloads

Sauce Test Status

Documentation

Please see the documentation here.

The source code of the website can be found here. Contributions are welcome!

Debug / logging

In order to see all the client debug output, run the following command on the browser console including the desired scope and reload your app page:

localStorage.debug = '*';

And then, filter by the scopes you're interested in. See also: https://socket.io/docs/v3/logging-and-debugging/

License

MIT

Description
No description provided
Readme MIT 43 MiB
Languages
TypeScript 63.8%
JavaScript 36%