I'm coming from years with Apollo and GraphQL.

I wanna create a small project using Vue and simple REST API.

I read about Vuex, I wanna know:

  1. Is there a way to persist the store in browser so if I restart the browser window (or if I close and reopen the next day) I immediately get the data that are stale but immediate?

  2. Is there a way to refetch that data from backend (using REST API calls) MEANWHILE I'm seeing the stale data? In Apollo / URQL and GraphQL world I can do this using requestPolicy: "cache-and-network" for each request. Is there something similar in Vuex?

0

There are 0 best solutions below