Async Javascript Promise Example

Promise A

Promise is a Pattern.

Javascript is Single Thread. if script code run blocking code,,script wait until blocking code finished.

we execute asynchronous program,we can do other things.

var callbackId = 0;

function getSystemInfo(callback) {
  document.location = "of://SystemInfo.getSystemInfo/"+callbackId+"/";
}

Native Success

OF.callbackSuccess('callbackId','datafewfwfewfwe');

댓글