nuxt-spa-store-init

A simple Nuxt module that will hydrate the VueX store when running in SPA mode (not SSR)
4,282 14
Install
npm install nuxt-spa-store-init
Latest Version:1.4.0
License:MIT
Last Updated:Apr 8, 2022
Links: GitHub  ·  npm
Maintainer: weotch

nuxt-spa-store-init

A simple Nuxt module that will hydrate the VueX store when running in SPA mode, whether this is because you are running yarn dev --spa or you're using the fallback option of yarn generate. It is based on this comment as well as this comment and calls the root Vuex action nuxtServerInit() if it hasn't run yet.

Install

  1. yarn add nuxt-spa-store-init or npm install --save nuxt-spa-store-init
  2. Add to nuxt.config.js under modules: modules: ['nuxt-spa-store-init']

Usage

Ensure your nuxtServerInit action in store/index.js returns a Promise. Other than that, it just works automatically.

Related Packages

vuex-pathify

Ridiculously simple Vuex setup + wiring

322,817 1,358
@pinia/nuxt

Nuxt Module for pinia

34,268,649 14,743
nuxt3-vuex-module

Vuex support for Nuxt 3

165,911 26
nuxt-resource-based-api

Provide extremely efficient way to handle API on Nuxt.js.

982 3
@vaxee/nuxt

Nuxt Module for Vaxee

1,857 74

Version History

Version Released License
1.4.0 MIT
1.3.0 MIT
1.2.1 MIT
1.2.0 MIT
1.1.0 MIT