import cookie from 'cookie' import {Swindon, Lattice} from 'swindon' class { onCreate() { var {swindon_presence_login} = cookie.parse(document.cookie) this.swindon = new Swindon('ws://' + location.host) this.state = { login: swindon_presence_login, lattice: new Lattice({onUpdate: this.lattice_update.bind(this)}), } } onMount() { this.guard = this.swindon.guard() .lattice('swindon.user', '', this.state.lattice) } onUnmount() { this.guard.close() } lattice_update(keys, lat) { this.forceUpdate() } }

Logged in as: ${state.login}

Other users: