mirror of
https://github.com/status-im/realm-js.git
synced 2025-01-10 14:25:58 +00:00
doc additions (#724)
* doc additions * Update sync.js * Update sync.js Mirror previous update to call parameter in callback `change_event` to match classname
This commit is contained in:
parent
c1e7ddcda1
commit
02d51d6efe
20
docs/sync.js
20
docs/sync.js
@ -26,22 +26,28 @@ class Sync {
|
||||
* @param {SyncUser} admin_user - an admin user obtained by calling `new Realm.Sync.User.adminUser`
|
||||
* @param {string} regex - a regular expression used to determine which cahnged Realms should trigger events -
|
||||
* Use `.*` to match all all Realms
|
||||
* @param {function(change_object)} change_callback - called on when changes are made to any Realm which
|
||||
* @param {string} name - The name of event that should cause the callback to be called
|
||||
* _Currently only the 'change' event is supported_
|
||||
* @param {function(change_event)} change_callback - called when changes are made to any Realm which
|
||||
* match the given regular expression
|
||||
*/
|
||||
static addListener(server_url, admin_user, regex, change_callback) {}
|
||||
static addListener(server_url, admin_user, regex, name, change_callback) {}
|
||||
|
||||
/**
|
||||
* Remove a previously registered sync listener
|
||||
* @param {string} regex - the regular expression previously used to register the listener
|
||||
* @param {function(change_object)} change_callback - the previously registered callback to be removed
|
||||
* @param {string} name - The event name
|
||||
* _Currently only the 'change' event is supported_
|
||||
* @param {function(change_event)} change_callback - the previously registered callback to be removed
|
||||
*/
|
||||
static removeListener(regex, change_callback) {}
|
||||
static removeListener(regex, name, change_callback) {}
|
||||
|
||||
/**
|
||||
* Remove all previously regiestered listeners
|
||||
* @param {string} [name] - The name of the event whose listeners should be removed.
|
||||
* _Currently only the 'change' event is supported_
|
||||
*/
|
||||
static removeAllListeners() {}
|
||||
static removeAllListeners(name) {}
|
||||
|
||||
/**
|
||||
* Set the sync log level.
|
||||
@ -52,10 +58,10 @@ class Sync {
|
||||
}
|
||||
|
||||
/**
|
||||
* Object passed
|
||||
* Change info passed when receiving sync 'change' events
|
||||
* @memberof Realm.Sync
|
||||
*/
|
||||
class ChangeObject {
|
||||
class ChangeEvent {
|
||||
/**
|
||||
* The path of the changed Realm
|
||||
* @type {string}
|
||||
|
Loading…
x
Reference in New Issue
Block a user