How to save page to keep running even when leaving it

I want that even if the user leaves some page, the page will keep running in the background and by the time the user returns to it again, the page will not get loaded all over again, but will be fetched from active state.

I am using F7 V4 + React and Webpack. How can I achieve something like this?

I have tried this:

{
    path: '/my-page/',
    options: {
      pushState: true,
      transition: 'f7-circle',
    },
    on: {
      pageBeforeIn: function (event, page) {
        console.log(`hello`)
      },
    },
    component: MyPage 
  },

What configured in the options is actually not working - there is no effect.
What configured in the β€œon” property is working - the log shows.

Basically I want to display a map and load it only once.

I think you can use setInterval to make some function always running on page:beforeout

https://framework7.io/docs/routes.html#keep-alive

1 Like

Thanks, it works as expected.