mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Merge pull request #4599 from yurydelendik/issue4428
Adds then method to the RenderTask
This commit is contained in:
commit
6ac7f97dae
1 changed files with 12 additions and 0 deletions
|
@ -1194,6 +1194,18 @@ var RenderTask = (function RenderTaskClosure() {
|
|||
cancel: function RenderTask_cancel() {
|
||||
this.internalRenderTask.cancel();
|
||||
this.promise.reject(new Error('Rendering is cancelled'));
|
||||
},
|
||||
|
||||
/**
|
||||
* Registers callback to indicate the rendering task completion.
|
||||
*
|
||||
* @param {function} onFulfilled The callback for the rendering completion.
|
||||
* @param {function} onRejected The callback for the rendering failure.
|
||||
* @return {Promise} A promise that is resolved after the onFulfilled or
|
||||
* onRejected callback.
|
||||
*/
|
||||
then: function RenderTask_then(onFulfilled, onRejected) {
|
||||
return this.promise.then(onFulfilled, onRejected);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue