You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To add detail to the remaining desired async functionality, consider this use pattern:
constclicks=client.getMessageResponse("customEHR.watchUserClicks",{...payload});forawait(letclickofclicks.generator){/// async generator syntax... something kinda like thisconsole.log("User clicked at",click);if(click.x===click.y){// because *of course* we're building a y===x detector app...clickGenenerator.cancel();// unregister a promise or generator// so the client can free up memorybreak;// technically}console.log("Waiting for another click...")}
This behavior has not been described by the IG, but it has been discussed as a favorable pattern and specifically encouraged for further experimentation.
swm.sendMessage('customEHR.watchClicks', {...payload})
- handle a stream of responses via generatorswm.createClient
- creates a client object using the messaging handle and target originclient.sendMessage('status.handshake')
- or any other known types. returns a promise.client.sendResponseTo(message)
- reads the messageId and sets responseToMessageIdswm.discover()
- returns library detailsThe text was updated successfully, but these errors were encountered: