index.js 697 B

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