feat: added vuex store to cache data; feat: cached home data in the frontend
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import store from '@/store'
|
||||
|
||||
export const socket = io.connect(window.location.href)
|
||||
|
||||
socket.on('connect', () => {
|
||||
@@ -8,8 +10,6 @@ socket.on('connect', () => {
|
||||
// console.log(data)
|
||||
// })
|
||||
|
||||
// socket.on('init_home', data => {
|
||||
// console.log(data)
|
||||
// localStorage.setItem('test_DELETE', JSON.stringify(data))
|
||||
// console.log(JSON.parse(localStorage.getItem('test_DELETE')))
|
||||
// })
|
||||
socket.on('init_home', data => {
|
||||
store.dispatch('cacheHomeData', data)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user