How to “mark everything as read”?

I have a Drupal 8 site with Message and Flag modules.

I created a view that displays messages. Messages have a “read” or “unread” flag. How to create a link in the header of my view for “Mark all as read” ?

I do not want to use “Mass Operation” which adds checkboxes and 2 buttons to my view.

I want a simple link “Mark as read” (ajax) to flag all messages on the page.