Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
xxdk-wasm
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
xxdk-wasm
Commits
c9280e2b
Commit
c9280e2b
authored
1 year ago
by
Richard T. Carback III
Browse files
Options
Downloads
Patches
Plain Diff
Convert the ListenOn* funcs to be non-async
parent
219a3da6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!109
Project/haven beta
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
wasm/collective.go
+10
-20
10 additions, 20 deletions
wasm/collective.go
with
10 additions
and
20 deletions
wasm/collective.go
+
10
−
20
View file @
c9280e2b
...
...
@@ -420,17 +420,12 @@ func (r *RemoteKV) ListenOnRemoteKey(_ js.Value, args []js.Value) any {
localEvents
=
args
[
3
]
.
Bool
()
}
promiseFn
:=
func
(
resolve
,
reject
func
(
args
...
any
)
js
.
Value
)
{
id
,
err
:=
r
.
api
.
ListenOnRemoteKey
(
key
,
version
,
cb
,
localEvents
)
if
err
!=
nil
{
reject
(
exception
.
NewTrace
(
err
))
}
else
{
resolve
(
id
)
}
id
,
err
:=
r
.
api
.
ListenOnRemoteKey
(
key
,
version
,
cb
,
localEvents
)
if
err
!=
nil
{
exception
.
ThrowTrace
(
err
)
}
return
utils
.
CreatePromise
(
promiseFn
)
return
id
}
// ListenOnRemoteMap allows the caller to receive updates when the map or map
...
...
@@ -456,17 +451,12 @@ func (r *RemoteKV) ListenOnRemoteMap(_ js.Value, args []js.Value) any {
localEvents
=
args
[
3
]
.
Bool
()
}
promiseFn
:=
func
(
resolve
,
reject
func
(
args
...
any
)
js
.
Value
)
{
id
,
err
:=
r
.
api
.
ListenOnRemoteMap
(
mapName
,
version
,
cb
,
localEvents
)
if
err
!=
nil
{
reject
(
exception
.
NewTrace
(
err
))
}
else
{
resolve
(
id
)
}
id
,
err
:=
r
.
api
.
ListenOnRemoteMap
(
mapName
,
version
,
cb
,
localEvents
)
if
err
!=
nil
{
exception
.
ThrowTrace
(
err
)
}
return
utils
.
CreatePromise
(
promiseFn
)
return
id
}
// GetAllRemoteKeyListeners returns a JSON list of { key: [id, id, id, ...] },
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment