New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@pinia-plugin-persistedstate/hmr

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pinia-plugin-persistedstate/hmr

> Override for Pinia's `acceptHMRUpdate`

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@pinia-plugin-persistedstate/hmr

Override for Pinia's acceptHMRUpdate

🚀 Quickstart

  1. Install with your favorite package manager:

    • pnpm : pnpm i -D @pinia-plugin-persistedstate/hmr
    • npm : npm i -D @pinia-plugin-persistedstate/hmr
    • yarn : yarn add -D @pinia-plugin-persistedstate/hmr
  2. Replace acceptHMRUpdate in your store definition file with:

import { defineStore } from 'pinia'
import { acceptHMRUpdateWithHydration } from '@pinia-plugin-persistedstate/hmr'

const useStore = defineStore('store', {
  // ...
})

if (import.meta.hot)
  import.meta.hot.accept(acceptHMRUpdateWithHydration(useStore, import.meta.hot))

⚠️ Warning

This is a copy/paste of Pinia's acceptHMRUpdate function that triggers $hydrate on HMR update. Use at your own risk. :)

📝 License

Copyright © 2022 Sacha Bouillez.
This project is under MIT license.

FAQs

Package last updated on 09 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc