GithubHelp home page GithubHelp logo

Comments (7)

prazdevs avatar prazdevs commented on May 31, 2024 1

Finally implemented and released it in V2 🎉
Closing this !

from pinia-plugin-persistedstate.

prazdevs avatar prazdevs commented on May 31, 2024

Hi thanks for opening the issue. I didn't specify it in the guideline or such, but I don't speak any Chinese :/ Could you rephrase the whole thing in English so I can help you ?

Thanks!

from pinia-plugin-persistedstate.

zhuzhengshou avatar zhuzhengshou commented on May 31, 2024

sorry, It's my thoughtlessness!
well, I mean this tool is very good。so that I hope it can be better。
for example:
I hope when I use defineStore of pinia , based on your expanded parameter -- persist,Its value can be an array(persist?: boolean | PersistedStateOptions | PersistedStateOptions[])。
because, Sometimes,all data in one store, hope can be persisted in different storage(localStorage, sessionStorage)

export const userStore = defineStore('user', {
  state: () => {
    return {
      key1: '',
      key2: ''
    }
  },
  persist: [
    {
      key: 'piniaUserStoreInSession',
      storage: window.sessionStorage,
      paths: ['key1']
    },
    {
      key: 'piniaUserStoreInLocal',
      storage: window.localStorage,
      paths: ['key2']
    }
  ]
})

The above is through translation software, If there is any inaccuracy, I hope you will forgive me!

from pinia-plugin-persistedstate.

prazdevs avatar prazdevs commented on May 31, 2024

Ooooh I see it now, the example code helped a lot. The idea seems interesting. I'll consider it and try to implement this when i get some time. I'm just a bit concerned with performance but that would be documented.

(no worries as for English, it's more than i need to understand your problem!)

from pinia-plugin-persistedstate.

prazdevs avatar prazdevs commented on May 31, 2024

Hi, as I thought about implementing this, I came across an issue.
If a same paths is stored in different stores, how about rehydration? That would let the possibility to have 2 different sources of rehydration 🤔

from pinia-plugin-persistedstate.

zhuzhengshou avatar zhuzhengshou commented on May 31, 2024

Hi, as I thought about implementing this, I came across an issue. If a same paths is stored in different stores, how about rehydration? That would let the possibility to have 2 different sources of rehydration 🤔

It's nice to hear from you again.
can you list some scenes at work?
because, I think nobody use like this(a same paths is stored in different stores).
if It won't be used like that, maybe can throw a error to prevent the problem?

from pinia-plugin-persistedstate.

N0tExisting avatar N0tExisting commented on May 31, 2024

@zhuzhengshou or @prazdevs could one of you please change the issue title to English?

from pinia-plugin-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.