Persist users.

This commit is contained in:
Roger Braun 2017-02-14 22:42:13 +01:00
parent 1d64b76211
commit 370468bd6a
3 changed files with 25 additions and 2 deletions

View file

@ -23,7 +23,8 @@
"vue": "^2.0.1",
"vue-router": "^2.0.1",
"vue-timeago": "^3.1.2",
"vuex": "^2.0.0"
"vuex": "^2.0.0",
"vuex-persistedstate": "^1.1.0"
},
"devDependencies": {
"autoprefixer": "^6.4.0",

View file

@ -16,6 +16,8 @@ import configModule from './modules/config.js'
import VueTimeago from 'vue-timeago'
import createPersistedState from 'vuex-persistedstate'
Vue.use(Vuex)
Vue.use(VueRouter)
Vue.use(VueTimeago, {
@ -25,13 +27,18 @@ Vue.use(VueTimeago, {
}
})
const persistedStateOptions = {
paths: ['users.users']
}
const store = new Vuex.Store({
modules: {
statuses: statusesModule,
users: usersModule,
api: apiModule,
config: configModule
}
},
plugins: [createPersistedState(persistedStateOptions)]
})
const routes = [

View file

@ -3495,6 +3495,10 @@ lodash.merge@^3.3.2:
lodash.keysin "^3.0.0"
lodash.toplainobject "^3.0.0"
lodash.merge@^4.6.0:
version "4.6.0"
resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.0.tgz#69884ba144ac33fe699737a6086deffadd0f89c5"
lodash.pairs@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/lodash.pairs/-/lodash.pairs-3.0.1.tgz#bbe08d5786eeeaa09a15c91ebf0dcb7d2be326a9"
@ -4011,6 +4015,10 @@ object-component@0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/object-component/-/object-component-0.0.3.tgz#f0c69aa50efc95b866c186f400a33769cb2f1291"
object-path@^0.11.2:
version "0.11.3"
resolved "https://registry.yarnpkg.com/object-path/-/object-path-0.11.3.tgz#3e21a42ad07234d815429ae9e15c1c5f38050554"
object.omit@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.0.tgz#868597333d54e60662940bb458605dd6ae12fe94"
@ -5734,6 +5742,13 @@ vuex:
version "2.0.0"
resolved "https://registry.yarnpkg.com/vuex/-/vuex-2.0.0.tgz#26befa44de220f009e432d1027487bff29571cee"
vuex-persistedstate:
version "1.1.0"
resolved "https://registry.yarnpkg.com/vuex-persistedstate/-/vuex-persistedstate-1.1.0.tgz#94f2e94a873f39fc716dea3129af45df8d4d6f78"
dependencies:
lodash.merge "^4.6.0"
object-path "^0.11.2"
watchpack@^0.2.1:
version "0.2.9"
resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-0.2.9.tgz#62eaa4ab5e5ba35fdfc018275626e3c0f5e3fb0b"