7 months ago

list of users online

Posted 7 months ago by ThePoet444

I currently have a list of all users using the site. I am using laravel echo server. Everything works as it should. The questions I have are this:

  1. is this the correct way to do it?
  2. The user will "blink" when they go to a new page of the site. While I understand why this happens and it is indeed normal, I'm curious if there is a way I can prevent it. IE, user 2 will go from main page to a news article and user 1 will see user 2 "blink" because of the page shift.

let app = new Vue({
    el: '#app',
    data: {
        onlineUsers: []
    mounted() {
            .here(onlineUsers => (this.onlineUsers = onlineUsers))
            .joining(user => this.onlineUsers.push(user))
            .leaving(user => (this.onlineUsers = this.onlineUsers.filter(u => ( !==

    <h4>Users Online</h4>

        <li class="linone" v-for="user in onlineUsers" v-text=""></li>

Please sign in or create an account to participate in this conversation.