mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
Change the createPromiseCapability
helper function into a PromiseCapability
class
This is not only slightly more compact, but it also simplifies the handling of the `settled` getter.
This commit is contained in:
parent
f9c2a8d437
commit
317abd6d07
24 changed files with 117 additions and 122 deletions
|
@ -13,7 +13,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createPromiseCapability, getFilenameFromUrl } from "pdfjs-lib";
|
||||
import { getFilenameFromUrl, PromiseCapability } from "pdfjs-lib";
|
||||
import { BaseTreeViewer } from "./base_tree_viewer.js";
|
||||
import { waitOnEventOrTimeout } from "./event_utils.js";
|
||||
|
||||
|
@ -50,7 +50,7 @@ class PDFAttachmentViewer extends BaseTreeViewer {
|
|||
if (!keepRenderedCapability) {
|
||||
// The only situation in which the `_renderedCapability` should *not* be
|
||||
// replaced is when appending FileAttachment annotations.
|
||||
this._renderedCapability = createPromiseCapability();
|
||||
this._renderedCapability = new PromiseCapability();
|
||||
}
|
||||
this._pendingDispatchEvent = false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue