Skip to content
Permalink
Browse files

disable vuex, add vue-stator, store/state.js

  • Loading branch information...
galvez committed Oct 20, 2019
1 parent 59148f5 commit 59ea67bb2caf9d764c85fac438dd60e9ebced809
Showing with 1,895 additions and 1,480 deletions.
  1. +3 −2 nuxt.config.js
  2. +3 −2 package.json
  3. +1 −25 store/index.js
  4. +24 −0 store/state.js
  5. +1,864 −1,451 yarn.lock
@@ -25,9 +25,10 @@ export default {
start_url: '/news'
},

devModules: [
buildModules: [
'@nuxtjs/pwa',
'@nuxtjs/axios'
'@nuxtjs/axios',
'vue-stator/nuxt'
],

axios: {
@@ -30,11 +30,12 @@
},
"dependencies": {
"@nuxtjs/axios": "^5.5.3",
"nuxt": "^2.8.0"
"nuxt": "^2.10.1",
"vue-stator": "^0.0.10"
},
"devDependencies": {
"@nuxtjs/pwa": "3.0.0-beta.8",
"@nuxtjs/eslint-config": "^0.0.1",
"@nuxtjs/pwa": "3.0.0-beta.8",
"babel-eslint": "^10.0.1",
"eslint": "^5.16.0",
"eslint-config-standard": "^12.0.0",
@@ -1,34 +1,10 @@
import Vue from 'vue'
import { CancelToken } from 'axios'

import { validFeeds } from '~/common/api'
import { lazy } from '~/common/utils'
import { CancelToken } from 'axios'

// Learn more on https://nuxtjs.org/guide/vuex-store

// =================================================
// State
// =================================================
export const state = () => {
const s = {
items: {
/* [id: number]: Item */
},
users: {
/* [id: string]: User */
},
feeds: {
/* [page: number] : [ [id: number] ] */
}
}

validFeeds.forEach((feed) => {
s.feeds[feed] = {}
})

return s
}

// =================================================
// Mutations
// =================================================
@@ -0,0 +1,24 @@
// =================================================
// State
// =================================================
import { validFeeds } from '~/common/api'

export default () => {
const s = {
items: {
/* [id: number]: Item */
},
users: {
/* [id: string]: User */
},
feeds: {
/* [page: number] : [ [id: number] ] */
}
}

validFeeds.forEach((feed) => {
s.feeds[feed] = {}
})

return s
}

0 comments on commit 59ea67b

Please sign in to comment.
You can’t perform that action at this time.