index.js 647 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import Vue from 'vue'
  2. import Vuex from '../../../src'
  3. import * as actions from './actions'
  4. import mutations from './mutations'
  5. Vue.use(Vuex)
  6. export default new Vuex.Store({
  7. state: {
  8. currentThreadID: null,
  9. threads: {
  10. /*
  11. id: {
  12. id,
  13. name,
  14. messages: [...ids],
  15. lastMessage
  16. }
  17. */
  18. },
  19. messages: {
  20. /*
  21. id: {
  22. id,
  23. threadId,
  24. threadName,
  25. authorName,
  26. text,
  27. timestamp,
  28. isRead
  29. }
  30. */
  31. }
  32. },
  33. actions,
  34. mutations,
  35. middlewares: process.env.NODE_ENV !== 'production'
  36. ? [Vuex.createLogger()]
  37. : []
  38. })