triniwiz / nativescript-socketio

Socket.IO for nativescript
Apache License 2.0
71 stars 31 forks source link

r.removeListener is not a function #58

Closed xeroxstar closed 6 years ago

xeroxstar commented 6 years ago

Hello, i am trying to remove a emit function with removeListener but i getting an error:

System.err: TypeError: r.removeListener is not a function System.err: File: "file:///data/data/org.nativescript.application/files/app/app.js, line: 1, column: 6442

I tried to declare "off" function in socketio.t.ds file but still, it does not work. Here is the basic code:

socketIO = new SocketIO(url, options);
socketIO.removeListener('hello');  //socketIO.off('hello')
socketIO .on('hello',function(data){
})
triniwiz commented 6 years ago

You can use the off now added https://github.com/triniwiz/nativescript-socketio/commit/34970539e755e3128406be87205b23043faef545