-
Notifications
You must be signed in to change notification settings - Fork 5
/
sync-client-custom.js
52 lines (42 loc) · 1.36 KB
/
sync-client-custom.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
///////////////////////////
// Customizable handlers //
///////////////////////////
SyncClient.prototype.onOnline = function(){
// Sync client is conncted to server and authenticated.
console.log("Client has gone online");
};
SyncClient.prototype.onOffline = function(){
// Sync client is conncted to server and authenticated.
console.log("Client has gone offline");
};
SyncClient.prototype.onConnected = function(){
// Sync client is conncted to server
console.log("Client connected to server");
};
SyncClient.prototype.onAuthenticated = function(){
// Sync client is conncted to server AND authenticated.
console.log("Client authenticated");
};
SyncClient.prototype.onConnectionError = function(){
console.log("Failed to connect to the server");
};
SyncClient.prototype.onDisconnected = function(){
// Sync client is disconncted from server.
console.log("Client disconnected from server");
};
SyncClient.prototype.onSyncPending = function(){
// Sync has started.
console.log("Sync started");
};
SyncClient.prototype.onSyncEndDefault = function(reactive){
// Sync ended successfully.
console.log("Sync ended successfully");
};
SyncClient.prototype.onSyncError = function(err){
// Sync aborted with error.
console.log("Sync aborted: " + err);
};
SyncClient.prototype.onSyncCancel = function(err){
// Sync aborted with warning.
console.log("Sync aborted: " + err);
};