junjizhi / junji-blog

My own blog

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

biz logic in Vuex store or in view?

junjizhi opened this issue · comments

logic can be both driven by the vue or add the logic in actions

seems can be done in either way

Tricky questions:

  • should the chain action be driven in the view, or by store?
  • should have updateA and updateB, or a business logic to batch all updates in one call?
  • My temp answer:
    • let store handle the biz logic, because it needs to be shared any way
    • test store separately for those logic