I have a function like this:
function dataSend(type, message) {
return {
type: message
};
};
Which I am using like this:
io.sockets.emit('addToQueue', dataSend('error', 'User not found'));
But when it gets to the client side I get an object that is like
{ type: 'User not found' }
instead of
{ 'error': 'User not found' }
Why is this acting like this? I'm not sure how to fix this any information would be great thanks.