Progress class
>e; This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. >e;
Create a promise, but with progress reporting
Signature:
export declare class Progress<Result = unknown, CurrentProgress = unknown> extends Future<Result>
Extends: Future<Result>
Constructors
Constructor | Modifiers | Description |
---|---|---|
(constructor)(initialProgress) | (BETA) create a promise, but with progress reporting. |
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
progress | CurrentProgress | (BETA) get last reported progress (despite current progress state) |
Methods
Method | Modifiers | Description |
---|---|---|
inspect() | (BETA) inspect the current progress, for debug purpose only. | |
onProgress(listener) | (BETA) register a listener on progress report, and use the returned function to cancel listening. listeners won't receive messages on progress rejection | |
report(progress) | (BETA) report current progress no-op if progress has already fulfilled or rejected | |
run(fn, initialProgress) | static | (BETA) creates a new progress object and runs the given function with the progress as parameter, returns the created progress object. the function should report progress and call |