:boom: Vue plugin for work with local storage, session storage and memory storage from Vue context
Vue-ls is a powerful Vue.js plugin that provides an easy way to manage local storage, session storage, and memory storage right from the Vue context. It simplifies the task of storing, retrieving, and clearing data in the browser, making it an essential tool for developers who want to streamline their Vue applications. By using Vue-ls, you can effectively handle different types of storage with minimal hassle, ensuring that your application’s performance remains optimal.
The plugin is compatible with both Vue 1.x and 2.x, making it versatile for a variety of projects. With its straightforward API and features designed to enhance usability, Vue-ls elevates the process of data management in modern web applications.
Vue.ls.set(name, value, expire)
to persist data with optional expiry times, ensuring that your application can handle temporary and permanent data needs.Vue.ls.get(name, def)
, which intelligently returns the requested value or a default if it’s not found.Vue.ls.remove(name)
, which returns a boolean to confirm successful deletion.Vue.ls.clear()
, simplifying the management of storage during development or user actions.Vue.ls.on(name, callback)
to listen for changes to stored data across browser tabs, keeping your application in sync and up-to-date.