Skip to content

ElectronDownloadItem.once method

ElectronDownloadItem › once

Unofficial

Registers a one-time listener for the done event.

Signature:

once(event: "done", listener: (event: ElectronEvent, state: "cancelled" | "completed" | "interrupted") => void): this

Parameters:

Parameter Type Description
event "done" The event name.
listener (event: ElectronEvent, state: "cancelled" | "completed" | "interrupted") => void Called with the terminal state of the download.

Returns: thisThis download item instance.


Unofficial

Registers a one-time listener for the updated event.

Signature:

once(event: "updated", listener: (event: ElectronEvent, state: "interrupted" | "progressing") => void): this

Parameters:

Parameter Type Description
event "updated" The event name.
listener (event: ElectronEvent, state: "interrupted" | "progressing") => void Called with the current state of the download.

Returns: thisThis download item instance.