Making vuex state persistent



  • Hi everyone,

    Just being a beginner in VueJS I wonder how to make a state persistent between closing and reopening an Android app.

    I saw there are some plug-ins to add this functionality. But I wonder what is the advantage of using vuex, states and vuex-persist instead of using localStorage, for instance.

    BR Dirk



  • Um, vuex-persist uses localStorage (and other methods) to persist the state on the client. Vuex is necessary for medium to larger apps to make the Flux pattern of state management (a reactive programming technique) available within Vue. If you have a simple app and can do state with a global event bus, then you could just store what you need in localStorage too.

    Scott



  • Hey, Scott, thanks for your explanations, that helps me to get a better understanding of the use for vuex. Will just read something about what Flux patterns are 🙂

    BR
    Dirk


Log in to reply