A Pinia plugin that is able to undo and redo a action easily.
npm
npm install --save-dev pinia-plugin-undo-redo
yarn
yarn add -D pinia-plugin-undo-redo
pnpm
pnpm install -D pinia-plugin-undo-redo
main.js
import pinia from './store'
// omit...
app.use(pinia)
store.js
import { createPinia } from 'pinia'
import PiniaUndoAndRedo from '../../index'
const pinia = createPinia()
pinia.use(PiniaUndoAndRedo)
app use
import { useStore } from '@/store'
const store = useStore()
store.redo()
store.undo()