demo/chat/frontend/src/channelstream-demo/channelstream-chat-demo/channelstream-chat-demo.js
/** subscribes/unsubscribes users from channels in channelstream */
subscribes/unsubscribes users from channels in channelstream
subscribes / unsubscribes users from channels in channelstream
handleChannelsChange(e) {
        console.log('handleChannelsChange', e.detail);
        var connection = this.getConnection();
        var shouldUnsubscribe = connection.calculateUnsubscribe();
        if (shouldUnsubscribe.length > 0) {
            connection.unsubscribe(shouldUnsubscribe);
        }
        else {
            connection.subscribe();
        }
    }
handleChannelsChange ( e ) { console . log ( 'handleChannelsChange' , e . detail ) ; var connection = this . getConnection ( ) ; var shouldUnsubscribe = connection . calculateUnsubscribe ( ) ; if ( shouldUnsubscribe . length > 0 ) { connection . unsubscribe ( shouldUnsubscribe ) ; } else { connection . subscribe ( ) ; } }
subscribes/unsubscribes users from channels in channelstream
subscribes / unsubscribes users from channels in channelstream