index.js 671 B

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