One time call for asynchronous operations. See more about The side effects of the Replay Stack
xpertrule.onceAsync(function(completeCB) { /* your code goes here */ completeCB(myResult); });
For example...
var myResult = xpertrule.onceAsync(function(completeCB) {
$.ajax({
url: "http://acme.inc/service",
type: "POST",
data: {
recordID: 42
},
dataType: "json",
success: function(d) {
completeCB(d);
},
error: function(e) {
completeCB(false);
},
timeout: 10000
});
});