HerringtonDarkholme / kilimanjaro

typed vuex 2.0
62 stars 4 forks source link

Limitation: getters/actions/mutations need to be declared sequentially #4

Closed HerringtonDarkholme closed 7 years ago

HerringtonDarkholme commented 8 years ago

This means you cannot do this

import getters from './getters'
import actions from './actions'
import mutations from './mutations'

store.create({})
  .getter(getters)
  .action(actions)
  .mutation(mutations)

But have to fall back to this

// getter.ts
import store from './store'
export default store.getter(....)

// action.ts
import store from './getter'
export default store.action(....)

// mutation.ts
import store from './action'
export default store.mutaiton(...)
HerringtonDarkholme commented 7 years ago

Too hard to fix without significantly change API. I would say only redeclaring interface/class is the only way to achieve module split.