Skip to content

Instantly share code, notes, and snippets.

Last active Sep 11, 2020
What would you like to do?
Backend sample service: Calling and handling the service response in the editor
SampleServiceWrapper.get().hello("Guilherme", 5000).then((CapabilityResponse<String> response) -> {
// Sample - capability not available can be handled like this.
if (CapabilityResponseStatus.withName(response.getStatus()) == CapabilityResponseStatus.NOT_AVAILABLE) {;
// Sample - response completed can be handled like this.
if (CapabilityResponseStatus.withName(response.getStatus()) == CapabilityResponseStatus.OK) {;
return null;
}).catch_(error -> {
DomGlobal.console.error("Error caught: " + error);
return null;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment