@naturalcycles/vue-lib
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

@naturalcycles/vue-lib

Useful functions for Vue.js 2.x

npm min.gz size code style: prettier

Features

createLocalStoragePlugin

LocalStorage persistence plugin for Vuex 3.x (compatible with Vue 2.x).

Works in Nuxt (!).

interface GlobalState {
  count: number
}

const emptyState: GlobalState = {
  count: 0,
}

export const localStoragePlugin = createLocalStoragePlugin<GlobalState>({
  emptyState,
})

export const store = new Vuex.Store<GlobalState>({
  mutations: {},
  plugins: [localStoragePlugin],
})

Readme

Keywords

none

Package Sidebar

Install

npm i @naturalcycles/vue-lib

Weekly Downloads

2

Version

1.1.0

License

MIT

Unpacked Size

13.4 kB

Total Files

15

Last publish

Collaborators

  • kirillgroshkov
  • kribor