英語 での Promise object の使用例とその 日本語 への翻訳
{-}
-
Colloquial
-
Ecclesiastic
-
Computer
-
Programming
The Promise object.
The constructor syntax for a promise object is:.
A Promise object is returned.
The properties state and result of the Promise object are internal.
Get the promise object for this API.
Loads an audio file and decodes it and returns a promise object as jQuery.
Gets a Promise object containing the ID token payload.
APIs that access the network through the Kii Cloud SDK return a Promise object.
Returns: A Promise object that resolves to the displayed element.
If you omit successCallback and errorCallback, a Promise object is returned.
Returns a Promise object that contains the user's profile information.
If you didn't select the openid scopewhen adding the LIFF app to a channel, a Promise object containing null is returned.
Reject(reason) Returns a new Promise object that is rejected with the given reason.
A Promise object containing the string read by LINE's QR code reader is returned.
Instead, it will create and return a Promise object that resolves when the loading is complete.
The Promise object contains the BluetoothDeviceobject indicating information about the devices.
If you fail to enable the plugins, a Promise object containing the error information is returned.
The Promise object contains a Boolean object indicating whether or not the Bluetooth plugin can be used.
Instead, it will create and return a Promise object that resolves when the loading is complete.
A Promise object serves as a link between the executor(the“producing code” or“singer”) and the consuming functions(the“fans”), which will receive the result or error.
APIs that access the network will return a Promise object that conforms to the Promises/A+ specification.
To summarize, the executor should perform a job(usually something that takes time)and then call resolve or reject to change the state of the corresponding promise object.
Creating a Promise A Promise object is created using the new keyword and its constructor.
Even a simple generic wrapper function like cssAnimation(className)that will return the Promise object that gets resolved on transitionEnd could be of a great help.
You can get the Promise object that resolves when you run liff. init() for the first time after starting the LIFF app.
The function will return a Promise object, which resolves to a DialogView object when the dialog is created.
The key is that the Promise object returned by the asynchronous API is treated as the return value of the function within the then() method and chained to the next then() method.
You can chain processes by passing a Promise object from the function specified in the first then() method to the next then() method.
The caller gets the Promise object and calls a done(successFunc(data)) which will tell the Promise object to call this successFunc when the"data" is resolved.
The return value from the then method is another Promise object, so you can"chain" that into another then method, or the Promise's catch method, which also takes a callback.