Skip to content

Commit

Permalink
feat(type): migrate RootState type
Browse files Browse the repository at this point in the history
  • Loading branch information
lbwa committed Mar 7, 2020
1 parent 36e98ba commit 933eb34
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Vuex from 'vuex'
import createLogger from 'vuex/dist/logger'

import modules from './modules'
import globalNamespace from './global'
import globalNamespace, { RootState } from './global'
import { createResetPlugin } from '../plugins/store'

Vue.use(Vuex)
Expand All @@ -16,8 +16,6 @@ const plugins = (() => {
return plugins
})()

export type RootState = typeof globalNamespace.state

const store = new Vuex.Store<RootState>(
Object.assign(globalNamespace, {
modules,
Expand Down
2 changes: 1 addition & 1 deletion src/store/modules/history.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Module } from 'vuex'
import { Route } from 'vue-router'
import invariant from 'tiny-invariant'
import { RootState } from '../index'
import { RootState } from '../global'
import { RECORD_MAX_VAL } from '../../constants'

export type RecordItem = {
Expand Down
2 changes: 1 addition & 1 deletion src/store/modules/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Module } from 'vuex'
import { RootState } from '..'
import { RootState } from '../global'

const requireStoreModule = require.context(
'.',
Expand Down
2 changes: 1 addition & 1 deletion src/store/modules/user.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Vue from 'vue'
import { Module } from 'vuex'
import { RootState } from '..'
import { RootState } from '../global'
import { Ability, init, RouteWithAbility, reset } from 'v-access'
import { userLogin, fetchUserAbilities } from '@/effects'
import VueRouter from 'vue-router'
Expand Down

0 comments on commit 933eb34

Please sign in to comment.