soc221b/pinia-plugin-persistedstate-2

implement global key prefix

reslear opened this issue · 3 comments

add option, to add and strip prefix for localstorage

createPersistedStatePlugin({
  prefix: '_p_'
})

like have store with name account in localstorage key - _p_account

It is more flexible to provide a function plugin option:

const identity = _ => _

createPersistedStatePlugin({
  alterKey: (storeKey: string) => string = identity
})

Feel free to pull request 😄 .

Yes, it will be relevant only for localstorage, like sugar for no copy-past setItem,getItem )

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.