Utilities > Vuex Utilities


nuxt-spa-store-init 0.05


A simple Nuxt module that will hydrate the VueX store when running in SPA mode (not SSR)
  • nuxt
  • nuxt_module
  • vuex
  • store
last commit 3 years ago
14
Stargazers

Watchers
14
Open issues
0
22736
Downloads

Last 30 days
1045
Releases
5
52
Final Score

Quality
52
Popularity
7
Maintenance
98

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.