File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 1
- import { Server , Socket } from "socket.io" ;
1
+ import { Server } from "socket.io" ;
2
2
3
3
const io = new Server ( 8080 , {
4
4
cors : {
@@ -15,7 +15,7 @@ interface Todo {
15
15
16
16
let todos : Array < Todo > = [ ] ;
17
17
18
- io . on ( "connect" , ( socket : Socket ) => {
18
+ io . on ( "connect" , ( socket ) => {
19
19
socket . emit ( "todos" , todos ) ;
20
20
21
21
// note: we could also create a CRUD (create/read/update/delete) service for the todo list
Original file line number Diff line number Diff line change 1
- import { Server , Socket } from "socket.io" ;
1
+ import { Server } from "socket.io" ;
2
2
3
3
const io = new Server ( 8080 ) ;
4
4
5
- io . on ( "connect" , ( socket : Socket ) => {
5
+ io . on ( "connect" , ( socket ) => {
6
6
console . log ( `connect ${ socket . id } ` ) ;
7
7
8
8
socket . on ( "ping" , ( cb ) => {
You can’t perform that action at this time.
0 commit comments