Skip to content

Error type of params in callback of StatefulPromise<T>.progress() #410

@CubeSugarCheese

Description

@CubeSugarCheese

note that there two diffrent overloads of progress method.

    /**
     * Add an event listener which triggers when data receiving from server.
     */
    progress(callback: (received: string, total: string) => void): StatefulPromise<FetchBlobResponse>;

    /**
     * Add an event listener with custom configuration
     */
    progress(config: { count?: number; interval?: number }, callback: (received: number, total: number) => void): StatefulPromise<FetchBlobResponse>;

In fact, no matter which overload is called, the type of received and total are always string, not number.
It can prove by typeof.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions