watch method
dynamic
watch({})
Implementation
watch({
String? envId,
String? collectionName,
String? query,
int? limit,
Map<String, String>? orderBy,
Function? onChange,
Function? onError,
}) {
if (this._ws == null && this._wsInitPromise == null) {
this._initWebSocketConnection(reconnect: false);
}
var virtualClient = VirtualWebSocketClient(
envId: envId,
collectionName: collectionName,
query: query,
limit: limit,
orderBy: orderBy,
send: this.send,
login: this._webLogin,
isWSConnected: this._isWSConnected,
onceWSConnected: this._onceWSConnected,
getWaitExpectedTimeoutLength: this._getWaitExpectedTimeoutLength,
onWatchStart: this._onWatchStart,
onWatchClose: this._onWatchClose,
debug: true,
onChange: onChange,
onError: onError,
);
this._virtualWSClient.add(virtualClient);
this._watchIdClientMap[virtualClient.watchId] = virtualClient;
return virtualClient.listener;
}