1.0.8 • Published 5 years ago

vuex-gitstore v1.0.8

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

vuex-gitstore

Intended use with Electron or server side javascript as it needs access to the local file system. git-js dependency. Will save the entire store.state to individual json files for each key within the root. Options to pass a key to store only portions of the state.

import Vue from 'vue'
import Vuex from 'vuex'
import GitStore from 'vuex-gitstore'

Vue.use(Vuex)

const store = new Vuex.Store({
	plugins: [
		GitStore.install({})//pass options.
	]
})

export default store

Pass options

key if you only want to target one key within the vuex store state, assign it here. For example with Vuex ORM use {key : 'entities'},

repo rename the default repo folder/name to something else. default is 'data' {repo : 'my_data_repo'}

root_path change where the json files are kept. default is 'gitstoreData/' {repo : 'my_data/somewhere_else/'}

Use with Vuex ORM

import Vue from 'vue'
import Vuex from 'vuex'
import VuexORM from '@vuex-orm/core'
import config from '../../config'
import Item from '../models/Item'

Vue.use(Vuex)

const database = new VuexORM.Database()

database.register(Item)

const store = new Vuex.Store({
	plugins: [
  		VuexORM.install(database),
  		config.storage.driver.install({
	  		key : 'entities', 
	  		repo : 'darknote',
	  		root_path : 'darknoteData/'
  		})
  	]
})

export default store
1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago