Courses

Pinia: The Enjoyable Vue Store - Advanced Pinia - Pinia Plugins

In this lesson, we create a Pinia plugin to provide reusable undo/redo functionality for our stores. With Pinia plugins you are able do a wide variety of things including:

  • Adding custom properties
  • Adding custom methods
  • Watching the store’s state with dollar sign subscribe
  • Limiting the functionality to specific stores with a custom option
  • Implement side effects like local storage
  • Add new state
  • Add new actions/methods
  • Wrap existing actions/methods

Links