Realm.Sync

Related Classes

AuthError
ChangeEvent
Session
User
Realm.Sync.addListener(server_url, admin_user, regex, name, change_callback)
static

Add a sync listener to listen to changes across multiple Realms

Parameters:
  • server_url
    • Type: string
    • the sync server to listen to

  • admin_user
    • Type: SyncUser
    • an admin user obtained by calling new Realm.Sync.User.adminUser

  • regex
    • Type: string
    • a regular expression used to determine which cahnged Realms should trigger events - Use .* to match all all Realms

  • name
    • Type: string
    • The name of event that should cause the callback to be called Currently only the 'change' event is supported

  • change_callback
    • Type: function
    • called when changes are made to any Realm which match the given regular expression

Realm.Sync.removeAllListeners(name)
static

Remove all previously regiestered listeners

Parameters:
  • name optional
    • Type: string
    • The name of the event whose listeners should be removed. Currently only the 'change' event is supported

Realm.Sync.removeListener(regex, name, change_callback)
static

Remove a previously registered sync listener

Parameters:
  • regex
    • Type: string
    • the regular expression previously used to register the listener

  • name
    • Type: string
    • The event name Currently only the 'change' event is supported

  • change_callback
    • Type: function
    • the previously registered callback to be removed

Realm.Sync.setLogLevel(log_level)
static

Set the sync log level.

Parameters:
  • log_level
    • Type: string
LogLevel
Type:
"error" or "info" or "debug"