feat: added vuex store to cache data; feat: cached home data in the frontend

This commit is contained in:
Roberto Tonino
2020-08-23 00:39:31 +02:00
parent 972d1fe680
commit 9425569879
10 changed files with 154 additions and 16 deletions

View File

@@ -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)
})