Skip to content
Snippets Groups Projects

Updates for client HavenBeta

Merged Richard T. Carback III requested to merge hotfix/BetaUpdates into project/HavenBeta
1 file
+ 14
2
Compare changes
  • Side-by-side
  • Inline
+ 14
2
@@ -385,6 +385,7 @@ func (r *RemoteKV) GetMapElement(_ js.Value, args []js.Value) any {
// - args[0] - the key string
// - args[1] - the version int
// - args[2] - the [KeyChangedByRemoteCallback] javascript callback
// - args[3] - set the localEvents flag to true or false (optional)
//
// Returns a promise with an error if any or the json of the existing
// [versioned.Object], e.g.:
@@ -396,8 +397,13 @@ func (r *RemoteKV) ListenOnRemoteKey(_ js.Value, args []js.Value) any {
version := int64(args[1].Int())
cb := newKeyChangedByRemoteCallback(args[2])
localEvents := true
if !args[3].IsUndefined() {
localEvents = args[3].Bool()
}
promiseFn := func(resolve, reject func(args ...any) js.Value) {
err := r.api.ListenOnRemoteKey(key, version, cb, true)
err := r.api.ListenOnRemoteKey(key, version, cb, localEvents)
if err != nil {
reject(exception.NewTrace(err))
} else {
@@ -415,6 +421,7 @@ func (r *RemoteKV) ListenOnRemoteKey(_ js.Value, args []js.Value) any {
// - args[0] - the mapName string
// - args[1] - the version int
// - args[2] - the [MapChangedByRemoteCallback] javascript callback
// - args[3] - set the localEvents flag to true or false (optional)
//
// Returns a promise with an error if any or the json of the existing
// the [map[string]versioned.Object] JSON value, e.g.:
@@ -426,8 +433,13 @@ func (r *RemoteKV) ListenOnRemoteMap(_ js.Value, args []js.Value) any {
version := int64(args[1].Int())
cb := newMapChangedByRemoteCallback(args[2])
localEvents := true
if !args[3].IsUndefined() {
localEvents = args[3].Bool()
}
promiseFn := func(resolve, reject func(args ...any) js.Value) {
err := r.api.ListenOnRemoteMap(mapName, version, cb, true)
err := r.api.ListenOnRemoteMap(mapName, version, cb, localEvents)
if err != nil {
reject(exception.NewTrace(err))
} else {
Loading