GithubHelp home page GithubHelp logo

Comments (8)

robinvdvleuten avatar robinvdvleuten commented on August 12, 2024 1

@robcresswell no problemo! It's better to solve issues by questioning than by solving with code ;)

from vuex-persistedstate.

robinvdvleuten avatar robinvdvleuten commented on August 12, 2024

@robcresswell could you explain your issue somewhat more detailed? Otherwise I can't help you.

from vuex-persistedstate.

robcresswell avatar robcresswell commented on August 12, 2024

I'm not sure how much more detail I can give. The question remains as above: is that nested key representation in localStorage expected, or is that a side effect of the library?

from vuex-persistedstate.

robinvdvleuten avatar robinvdvleuten commented on August 12, 2024

@robcresswell I am afraid I cannot help you if you do not give an example on how you've configured the plugin

from vuex-persistedstate.

robcresswell avatar robcresswell commented on August 12, 2024

Ah I see! Sorry, I couldn't tell what you were asking for from your initial comment. Like so:

...
import Settings from "./settings"
import persistedState from "vuex-persistedstate"

export default new Vuex.Store({
    modules: {
        settings: Settings,
        ...
    },
    plugins: [
        persistedState()
    ],
    strict: process.env.NODE_ENV !== "production"
})

The ... is where I've removed irrelevant things (like other imports) for brevity.

from vuex-persistedstate.

robinvdvleuten avatar robinvdvleuten commented on August 12, 2024

Thanks, looks like a normal setup of the plugin. How does the initial state of your settings module looks?

from vuex-persistedstate.

robcresswell avatar robcresswell commented on August 12, 2024
export default {
    state: {
        settings: {
            foo: "bar"
        }
    }
}

As I'm looking at this, I've realised that my module imports i.e. settings: Settings, combined with the key settings in the modules state, is probably what is causing the double nesting.

from vuex-persistedstate.

robcresswell avatar robcresswell commented on August 12, 2024

Yep, that was indeed the issue, my poor refactoring when using modules. Sorry for the trouble and thanks again for the library :)

from vuex-persistedstate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.