nuxt-community / observable-module

Nuxt.js module that injects a lightweight, Vue.observable()-based $state into the context

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@nuxtjs/observable

Setup

npm i @nuxtjs/observable --save

Usage

In nuxt.config.js:

export default {
  modules: [
    '@nuxtjs/observable'
  ]
}

Add state to <srcDir>/state.js:

export default () => ({
  foobar: 123
})

Access and modify directly (no commits, no dispatches) $state available in ctx or this.

Credits

Nuxt.js Team

About

Nuxt.js module that injects a lightweight, Vue.observable()-based $state into the context


Languages

Language:JavaScript 93.4%Language:Vue 6.6%