title: How to update my view in Drupal 8 without going back to the first page?
body: <p>I'm trying to refresh my View in Drupal 8 without reloading the page with this code :</p>
  
  <pre><code>(function ($, Drupal) {
  
    'use strict';
  
    setInterval(function() {
      $('.view-message-activity-stream-timeline-public').trigger('RefreshView');
    }, 10000);
  
  })(jQuery, Drupal);
  </code></pre>
  
  <p>My module :</p>
  
  <pre><code>&lt;?php
  
  /**
   * @file
   * Holds hook implementation for the Message Activity Stream module.
   */
  
  use Drupal\Core\Entity\ContentEntityBase;
  use Drupal\group\Entity\Group;
  use Drupal\node\Entity\Node;
  use Drupal\comment\Entity\Comment;
  use Drupal\commerce_store\Entity\Store;
  use Drupal\commerce_product\Entity\Product;
  use Drupal\user\Entity\User;
  use Drupal\message\Entity\Message;
  
  /**
   * Implements hook_ajax_render_alter().
   */
  function message_activity_stream_ajax_render_alter(array &amp;$data) {
    foreach ($data as $key =&gt; $command) {
      if ($command['command'] === 'viewsScrollTop') {
        unset($data[$key]);
        break;
      }
    }
  }
  
  /**
   * Implements hook_user_insert().
   */
  function message_activity_stream_user_insert(User $account) {
    $message = Message::create(['template' =&gt; 'mas_user_register', 'uid' =&gt; $account-&gt;id()]);
    $message-&gt;set('field_user_reference', $account);
    $message-&gt;save();
  }
  
  /**
   * Implements hook_commerce_store_insert().
   */
  function message_activity_stream_commerce_store_insert(Store $commerce_store) {
    $message = Message::create(['template' =&gt; 'mas_create_store', 'uid' =&gt; $commerce_store-&gt;get('uid')]);
    $message-&gt;set('field_store_reference', $commerce_store);
    $message-&gt;save();
  }
  
  /**
   * Implements hook_commerce_product_insert().
   */
  function message_activity_stream_commerce_product_insert(Product $commerce_product) {
    $message = Message::create(['template' =&gt; 'mas_create_product', 'uid' =&gt; $commerce_product-&gt;get('uid')]);
    $message-&gt;set('field_product_reference', $commerce_product);
    $message-&gt;save();
  }
  
  /**
   * Implements hook_group_insert().
   */
  function message_activity_stream_group_insert(Group $group) {
    $message = Message::create(['template' =&gt; 'mas_create_group', 'uid' =&gt; $group-&gt;get('uid')]);
    $message-&gt;set('field_group_reference', $group);
    $message-&gt;save();
  }
  
  /**
   * Implements hook_node_insert().
   */
  function message_activity_stream_node_insert(Node $node) {
    $message = Message::create(['template' =&gt; 'mas_create_node', 'uid' =&gt; $node-&gt;get('uid')]);
    $message-&gt;set('field_node_reference', $node);
    $message-&gt;save();
  }
  
  /**
   * Implements hook_comment_insert().
   */
  function message_activity_stream_comment_insert(Comment $comment) {
    $message = Message::create(['template' =&gt; 'mas_create_comment', 'uid' =&gt; $comment-&gt;getOwnerId()]);
    $message-&gt;set('field_comment_reference', $comment);
    $message-&gt;save();
  }
  </code></pre>
  
  <p>It works.</p>
  
  <p><strong>My problem :</strong></p>
  
  <p>At the bottom of my page I have a pagination button "Afficher plus" (the button that is the full width of the page). When the page refreshes automatically (every 10 seconds), it returns to the first page.</p>
  
  <p><a href="https://www.s1biose.com/fr" rel="nofollow noreferrer">https://www.s1biose.com/fr</a></p>