triniwiz / nativescript-socketio

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

how to use emit/on callback data ack in js ? #17

Closed developper89 closed 8 years ago

developper89 commented 8 years ago

if the callback argument is an ack how do we parse it to js object ? socketIO.on('login', function (data) { console.log("LoginSuccess: ", data); <= ack }) i would like to access data properties like: console.log("LoginSuccess: ", data.username);

developper89 commented 8 years ago

got it working using data[0]