https://github.com/naturalcycles/vue-lib
Useful functions for Vue.js
https://github.com/naturalcycles/vue-lib
typescript vue vuex
Last synced: about 2 months ago
JSON representation
Useful functions for Vue.js
- Host: GitHub
- URL: https://github.com/naturalcycles/vue-lib
- Owner: NaturalCycles
- Created: 2021-03-07T16:24:12.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-03-15T03:14:58.000Z (about 4 years ago)
- Last Synced: 2024-04-24T19:49:43.479Z (about 1 year ago)
- Topics: typescript, vue, vuex
- Language: TypeScript
- Homepage:
- Size: 104 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
## @naturalcycles/vue-lib
> Useful functions for Vue.js 2.x
[](https://www.npmjs.com/package/@naturalcycles/vue-lib)
[](https://bundlephobia.com/result?p=@naturalcycles/vue-lib)
[](https://github.com/prettier/prettier)# Features
## createLocalStoragePlugin
LocalStorage persistence plugin for [Vuex](https://github.com/vuejs/vuex) 3.x (compatible with Vue
2.x).Works in Nuxt (!).
```ts
interface GlobalState {
count: number
}const emptyState: GlobalState = {
count: 0,
}export const localStoragePlugin = createLocalStoragePlugin({
emptyState,
})export const store = new Vuex.Store({
mutations: {},
plugins: [localStoragePlugin],
})
```