Skip to content
This repository was archived by the owner on Feb 4, 2022. It is now read-only.
This repository was archived by the owner on Feb 4, 2022. It is now read-only.

How does this plugin handles object store variables? #90

@PrimozRome

Description

@PrimozRome

I am using vuex-persistedstate in my Nuxt.js projects. I am wondering how this Vuex plugin handles object variables inside my store? I am seeing strange behaviours.

Every time I hard-refresh my app [Command-R] my array inside store duplicates elements. Does this plugin adds values to store arrays?

My store is initialised like this:

import UsersTable from '@/assets/tables/users'

export const state = () => ({
  usersTable: UsersTable
})

So UsersTable is object like this:

export default {
  columns: [
    {
      name: 'profile.lastname',
      title: 'USER.LBL_LASTNAME',
      sortField: 'profile.lastname'
    },
    {
      name: 'email',
      title: 'USER.LBL_EMAIL',
      sortField: 'email'
    },
    {
      name: 'address.city',
      title: 'USER.LBL_CITY',
      sortField: 'address[0].city'
    }
  ]
}

Now after each refresh my store.usersTable.columns double... I am not sure what is happening here but I suspect that vuex-persistedstate plugin pushes values from local storage after the store get's initialised. Is this true?

If yes then this is questionable behaviour...? Anyone else having these problems?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions