1.0.0 • Published 3 years ago

@deepsource/nuxt-local-storage v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

DeepSourceDeepSource

Setup

  1. Add @deepsource/nuxt-local-storage dependency to your project
yarn add --dev @deepsource/nuxt-local-storage # or npm install -D @deepsource/nuxt-local-storage
  1. Add @deepsource/nuxt-local-storage to the buildModules section of nuxt.config.js
{
  buildModules: [
    '@deepsource/nuxt-local-storage',
  ]
}

Usage

nuxt-local-storage organizes your key/value pairs in stores, allowing you to separate data from different parts of your app. A store can have any number of key/value pairs

Access the plugin with $localStore

Storing data

this.$localStore.set('myStore', 'myKey', 'myValue')

Fetching data

Fetch a value by its key

this.$localStore.get('myStore', 'myKey') // myValue

Fetch an entire store

this.$localStore.get('myStore')// { myKey: "myValue" }

Deleting a key/value pair

this.$localStore.remove('myStore', 'myKey')

Clearing a store

this.$localStore.reset('myStore')

Development

  1. Clone this repository
  2. Install dependencies using yarn install
  3. Start development server using yarn dev

License

MIT License