examples/userlist/index.js
function update() {
	connection = new Connection(room)
	// set our funcitonal code on the ready event, so we are sure that the socket has been created and is connected to the server
	connection.on('ready', _ => {
		connection.on('snapshot-event', event => {
			// get every listener including bots and lurkers
			userList = event.data.listing.sort()
			render(userList)
			connection.close()
		})
	})
}
function update() {
	connection = new Connection(room)
	// set our funcitonal code on the ready event, so we are sure that the socket has been created and is connected to the server
	connection.on('ready', _ => {
		connection.on('snapshot-event', event => {
			// get every listener including bots and lurkers
			userList = event.data.listing.sort()
			render(userList)
			connection.close()
		})
	})
}
function update ( ) { connection = new Connection ( room ) // set our funcitonal code on the ready event, so we are sure that the socket has been created and is connected to the server connection . on ( 'ready' , _ => { connection . on ( 'snapshot-event' , event => { // get every listener including bots and lurkers userList = event . data . listing . sort ( ) render ( userList ) connection . close ( ) } ) } ) }
Update the userList global with new data from the targeted euphoria room. We use the snapshot even send on a new connect to update the userlist.
Update the userList global with new data from the targeted euphoria room . We use the snapshot even send on a new connect to update the userlist .