Skip to content

vkalinichev/logux-vuex

Repository files navigation

Logux Vuex

Based on Logux Redux by Andrey Sitnik

Logux is a client-server communication protocol. It synchronizes action between clients and server logs.

This library provides Vuex compatible API.

Install

npm install logux-vuex

Usage

import Vue from 'vue'
import Vuex from 'vuex'
+import { connectLogux } from 'logux-vuex'

Vue.use(Vuex)

+const LoguxStore = connectLogux(Vuex.Store, {
+  subprotocol: '1.0.0',
+  userId: 10,
+  url: 'wss://localhost:1337'
+})

-var store = new Vuex.Store({
+var store = new LoguxStore({
  state: {
    value: 0
  },
  mutations: {
    Inc: (state) {
      state.value++
    }
  }
})

See also Logux Status for UX best practices.

Releases

No releases published

Packages

No packages published