1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-14 02:06:29 +00:00

USER auto refresh

This commit is contained in:
Rokt33r
2015-10-18 20:18:16 +09:00
parent 88ee94d4b6
commit 0bdb8142c6
4 changed files with 13 additions and 9 deletions

View File

@@ -2,7 +2,7 @@ import { API_URL } from '../config'
import socketio from 'socket.io-client'
import auth from './auth'
import store from './store'
import { updateArticle, destroyArticle } from './actions'
import { updateUser, updateArticle, destroyArticle } from './actions'
export const CONN = 'CONN'
export const ALERT = 'ALERT'
@@ -27,6 +27,8 @@ io.on(ALERT, function (data) {
io.on(USER_UPDATE, function (data) {
console.log(USER_UPDATE, data)
let { user } = data
store.dispatch(updateUser(user))
})
io.on(ARTICLE_UPDATE, function (data) {