-
socket.io插件 for dva
资源介绍
dva-socket.io
dva 或Redux的socket.io插件。
用法
// Simple Usage
import dva from 'dva' ;
import createSocket from 'dva-socket.io' ;
const app = dva ( ) ;
app . use ( createSocket ( 'http://127.0.0.1:8080' , null , {
// when server push an server-message event,
// it will dispatch an action use server data,
on : [ 'server-message' ] ,
emit : [
// when you dispatch an action with type === 'sen