import socket from "$utils/socket";
import {NoticeType} from "$utils/socket/const";

import roomList from '$utils/control/roomList';

export default {
    key:'rid',

    install(){
        socket.on('entrust-follow-room-list',(params)=>{

            if (params.rid) {
                if (params.status) {
                    this.addItem(params.data,'unshift');
                } else {
                    this.removeItem(params.rid);
                }
                roomList.event.triggerAllListener(params);
            }

        },NoticeType.followRoom);

    }

}