trphoenix
2018-11-28 117664259ffca2f16ec47c5672012dfb6704b5ab
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
part of redux_remote_devtools;
 
class SocketClusterWrapper {
  Socket _socket;
  Function socketFactory;
  String url;
  SocketClusterWrapper(this.url, {this.socketFactory = Socket.connect});
 
  Future<void> connect() async {
    this._socket = await socketFactory(this.url);
  }
 
  Emitter on(String event, Function func) {
    return this._socket.on(event, func);
  }
 
  void emit(String event, Object data, [AckCall ack]) {
    this._socket.emit(event, data, ack);
  }
 
  get id => this._socket.id;
}