https://github.com/grandchef/vuex-persistedstate-migrate
Library to migrate vuex state using vuex-persistedstate
https://github.com/grandchef/vuex-persistedstate-migrate
state storage versioning vue vuex vuex-persistedstate
Last synced: 17 days ago
JSON representation
Library to migrate vuex state using vuex-persistedstate
- Host: GitHub
- URL: https://github.com/grandchef/vuex-persistedstate-migrate
- Owner: grandchef
- License: mit
- Created: 2021-03-15T11:15:04.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-08-31T14:29:03.000Z (over 3 years ago)
- Last Synced: 2025-03-20T13:32:31.828Z (about 1 month ago)
- Topics: state, storage, versioning, vue, vuex, vuex-persistedstate
- Language: TypeScript
- Homepage:
- Size: 77.1 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- stars - grandchef/vuex-persistedstate-migrate - persistedstate (HarmonyOS / Windows Manager)
README
[![TypeScript version][ts-badge]][typescript-42]
[![Node.js version][nodejs-badge]][nodejs]
[![MIT][license-badge]][LICENSE]# Vuex Persistedstate Migrate
Library to migrate vuex state using [vuex-persistedstate][vuex-persistedstate].
See on [npm][npm-link]## Install
Run command bellow on your project folder
```sh
yarn add vuex-persistedstate-migrate
```
or
```sh
npm install vuex-persistedstate-migrate
```## Example
```js
import Vuex from 'vuex'
import createPersistedState from 'vuex-persistedstate'
import createMigrate from 'vuex-persistedstate-migrate'const migrations = [
{
version: 1,
up: state => {
return {
...state,
myModule: {
...state.myModule,
myProperty: 'migrated value',
}
}
}
}
]Vue.use(Vuex)
const store = new Vuex.Store({
plugins: [createPersistedState({
getState: createMigrate(migrations, 'migration.version'),
})],
modules
})export default store
```## Available scripts
+ `clean` - remove coverage data, Jest cache and transpiled files,
+ `build` - transpile TypeScript to ES6,
+ `build:watch` - interactive watch mode to automatically transpile source files,
+ `lint` - lint source files and tests,
+ `style:fix` - fix prettier style problems,
+ `style:check` - check for prettier style,
+ `test` - run tests,
+ `test:watch` - interactive watch mode to automatically re-run tests
+ `test:debug` - run tests debugging## License
Licensed under the MIT. See the [LICENSE](https://github.com/grandchef/vuex-persistedstate-migrate/blob/master/LICENSE) file for details.[vuex-persistedstate]: https://github.com/robinvdvleuten/vuex-persistedstate#readme
[ts-badge]: https://img.shields.io/badge/TypeScript-4.2-blue.svg
[nodejs-badge]: https://img.shields.io/badge/Node.js->=%2010-blue.svg
[nodejs]: https://nodejs.org/dist/latest-v10.x/docs/api/
[typescript]: https://www.typescriptlang.org/
[typescript-42]: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-2.html
[license-badge]: https://img.shields.io/badge/license-MIT-blue.svg
[license]: https://github.com/grandchef/vuex-persistedstate-migrate/blob/master/LICENSE
[npm-link]: https://www.npmjs.com/package/vuex-persistedstate-migrate