You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,6 +65,8 @@ For full documentation, see the javaDoc style comments in the package which auto
65
65
66
66
Gets everything started (e.g. reconstitutes state from storage and reconciles it with downloads that might have completed in the background, subscribes to events, etc). You must call this first.
67
67
68
+
During initialization, `onBegin` and `onDone` handlers will be called for any files that were already successfully downloaded in previous app sessions, ensuring your app knows about all available files.
69
+
68
70
You can pass any of the following options, or nothing at all:
69
71
70
72
| Option | Type | Default | Description |
@@ -81,9 +83,9 @@ Here are the optional notification handlers you can pass to be informed of downl
|`onBegin?: (url: string, totalBytes: number) => void`|Calledwhenthedownloadhasbegunandthetotalnumberofbytesexpectedisknown.Alsocalledduring`init()`forfilesthatwerealreadydownloaded, just before `onDone` is called.|
85
87
|`onProgress?: (url: string, fractionWritten: number, bytesWritten: number, totalBytes: number) => void` | Called at most every 1.5 seconds for any file while it's downloading. `fractionWritten` is between 0.0 and 1.0|
|`onDone?: (url: string, localPath: string) => void`| Called when the download has completed successfully. `localPath` will be a file path. This is also called during `init()` for any files that were already downloaded in previous app sessions, giving you a complete picture of all available files.|
87
89
|`onWillRemove?: (url: string) => Promise<void>`| Called before any url is removed from the queue. This is async because `removeUrl` (andalso`setQueue`, whenitneedstoremovesomeurls) will block until you return from this, giving you the opportunity remove any dependencies on any downloaded local file before it's deleted.|
88
90
|`onError?: (url: string, error: any) => void`| Called when there's been an issue downloading the file. Note that this is mostly for you to communicate something to the user, or to do other housekeeping; DownloadQueue will automatically re-attempt the download every minute (while you're online) until it succeeds.|
0 commit comments