class SocketMiddWare { public route : string ; public cb : ( data : any ) => void ; public constructor ( route ) { this . route = route ; } public middWare ( data ) { console . log ( "data:" , data ) ; this . cb ( data ) ; } public setCb ( cb ) { this . cb = cb ; } }