1.0.0 • Published 3 years ago
@deepsource/nuxt-local-storage v1.0.0
Setup
- Add
@deepsource/nuxt-local-storage
dependency to your project
yarn add --dev @deepsource/nuxt-local-storage # or npm install -D @deepsource/nuxt-local-storage
- Add
@deepsource/nuxt-local-storage
to thebuildModules
section ofnuxt.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
- Clone this repository
- Install dependencies using
yarn install
- Start development server using
yarn dev
License
1.0.0
3 years ago