Skip to content

Commit

Permalink
docs(examples): remove unnecessary type annotations (#3855)
Browse files Browse the repository at this point in the history
Typed events in Socket.IO 4.0 remove the need for writing type
annotations in callbacks of reserved events.
  • Loading branch information
MaximeKjaer committed Mar 24, 2021
1 parent b4ae8d2 commit 259f297
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions examples/angular-todomvc/server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Server, Socket } from "socket.io";
import { Server } from "socket.io";

const io = new Server(8080, {
cors: {
Expand All @@ -15,7 +15,7 @@ interface Todo {

let todos: Array<Todo> = [];

io.on("connect", (socket: Socket) => {
io.on("connect", (socket) => {
socket.emit("todos", todos);

// note: we could also create a CRUD (create/read/update/delete) service for the todo list
Expand Down
4 changes: 2 additions & 2 deletions examples/typescript/server.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Server, Socket } from "socket.io";
import { Server } from "socket.io";

const io = new Server(8080);

io.on("connect", (socket: Socket) => {
io.on("connect", (socket) => {
console.log(`connect ${socket.id}`);

socket.on("ping", (cb) => {
Expand Down

0 comments on commit 259f297

Please sign in to comment.