function handleCounters(events = []) {
        flow(
            filter((event) => event.Message),
            map((event) => angular.copy(event.Message)),
            each((newMessage) => {
                const oldMessage = _.find(messagesCached, { ID: newMessage.ID });
                if (oldMessage) {
                    newMessage.LabelIDs = getLabelsId(oldMessage, newMessage);
                    manageCounters(oldMessage, newMessage, 'message');
                }
            })
        )(events);

        flow(
            filter((event) => event.Conversation),
            map((event) => angular.copy(event.Conversation)),
            each((newConversation) => {
                const oldConversation = _.find(conversationsCached, { ID: newConversation.ID });
                if (oldConversation) {
                    newConversation.Labels = getLabels(oldConversation, newConversation);
                    manageCounters(oldConversation, newConversation, 'conversation');
                }
            })
        )(events);

        cacheCounters.status();
    }
/**
     * Set new counters value from FE events
     * @param  {Array} events
     */
Set new counters value from FE events
@param  {Array} events
Set new counters value from FE events @param { Array } events
function handleCounters(events = []) {
        flow(
            filter((event) => event.Message),
            map((event) => angular.copy(event.Message)),
            each((newMessage) => {
                const oldMessage = _.find(messagesCached, { ID: newMessage.ID });
                if (oldMessage) {
                    newMessage.LabelIDs = getLabelsId(oldMessage, newMessage);
                    manageCounters(oldMessage, newMessage, 'message');
                }
            })
        )(events);
        flow(
            filter((event) => event.Conversation),
            map((event) => angular.copy(event.Conversation)),
            each((newConversation) => {
                const oldConversation = _.find(conversationsCached, { ID: newConversation.ID });
                if (oldConversation) {
                    newConversation.Labels = getLabels(oldConversation, newConversation);
                    manageCounters(oldConversation, newConversation, 'conversation');
                }
            })
        )(events);
        cacheCounters.status();
    }
function handleCounters ( events = [ ] ) { flow ( filter ( ( event ) => event . Message ) , map ( ( event ) => angular . copy ( event . Message ) ) , each ( ( newMessage ) => { const oldMessage = _ . find ( messagesCached , { ID : newMessage . ID } ) ; if ( oldMessage ) { newMessage . LabelIDs = getLabelsId ( oldMessage , newMessage ) ; manageCounters ( oldMessage , newMessage , 'message' ) ; } } ) ) ( events ) ; flow ( filter ( ( event ) => event . Conversation ) , map ( ( event ) => angular . copy ( event . Conversation ) ) , each ( ( newConversation ) => { const oldConversation = _ . find ( conversationsCached , { ID : newConversation . ID } ) ; if ( oldConversation ) { newConversation . Labels = getLabels ( oldConversation , newConversation ) ; manageCounters ( oldConversation , newConversation , 'conversation' ) ; } } ) ) ( events ) ; cacheCounters . status ( ) ; }
Set new counters value from FE events
 @param  {Array} events
Set new counters value from FE events @param { Array } events