Message from JavaScript discussions

February 2019

— L00P will fit, better!

— 

For now, I did io.connect(SERVER); for connecting the default namespace, but how can i connect the "chat" namespace, for example?

— Wat? You mean manual if else check

— Your HOST/ is the default
but HOST/NAMESPACE is the one you want.

— You have to create an io object every time you want to join a different namespace i think

— Manual?🤤

— Quoting the docs:

A new Socket instance is returned for the namespace specified by the pathname in the URL, defaulting to /. For example, if the url is http://localhost/users, a transport connection will be established to http://localhost and a Socket.IO connection will be established to /users.

Message permanent page

— Https://socket.io/docs/client-api/#IO

— So a var chat = io.connect(SERVER + "/chat") is enough?

— 

const elem = document
.querySelector('button');

if (elem) {
elem
.addEventListener('click', foo);
}


vs:

const elem = Maybe.of(
document
.querySelector('button'));

elem.map(x =>
x.addEventListener('click', foo));

Message permanent page

— I think

— I'll try