2.0.11 • Published 8 years ago

hinos-socketio v2.0.11

Weekly downloads
-
License
ISC
Repository
-
Last release
8 years ago

hinos-socketio

A plugin manages socketio connect for hinos

Install

npm i hinos-socketio -S

Examples

Typescript

Socketio configuration file

import { Server } from 'hinos';
import { Socketio } from 'hinos-socketio';

Socketio({
  server: Server.server,
  path: {
    'msg': undefined // Or {register(sessionId) { // Do something }} Or (socket: SocketIO.Socket) => { }
  }
}).debug(!Server.isProduction)

Service file

import { SOCKETIO, Socketio } from 'hinos-socketio';

export class ChartService {
    @SOCKETIO() 
    static socketio: Socketio;
    
    static async find(sessionId: string, data: any = {}) {
        await ChartService.socketio.send('/msg', sessionId, data);
    }
}
2.0.11

8 years ago

2.0.10

8 years ago

2.0.9

8 years ago

2.0.8

8 years ago

2.0.7

8 years ago

2.0.6

8 years ago

2.0.5

8 years ago

2.0.4

8 years ago

2.0.3

8 years ago

2.0.2

8 years ago

2.0.1

8 years ago

2.0.0

8 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago