Function acceptHMRUpdate

  • Creates an accept function to pass to import.meta.hot in Vite applications.

    Type Parameters

    Parameters

    • initialUseStore: StoreDefinition<Id, S, G, A>

      return of the defineStore to hot update

    • hot: any

      import.meta.hot

    Returns ((newModule) => any)

      • (newModule): any
      • Parameters

        • newModule: any

        Returns any

    Example

    const useUser = defineStore(...)
    if (import.meta.hot) {
    import.meta.hot.accept(acceptHMRUpdate(useUser, import.meta.hot))
    }

Generated using TypeDoc