-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ feat: implement non-blocking download into UI
- Loading branch information
david-vaclavek
committed
Oct 5, 2023
1 parent
27defe9
commit 9c2dee3
Showing
6 changed files
with
362 additions
and
305 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
export const UPLOAD_EVENT = "upload"; | ||
export const UPLOAD_FINISHED_EVENT = "upload:finished"; | ||
export const DOWNLOAD_EVENT = "download"; | ||
export const DOWNLOAD_FINISHED_EVENT = "download:finished"; |
12 changes: 12 additions & 0 deletions
12
admin/src/modules/localazy-download/services/download-alerts-service.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import AlertsService from "../../alerts/services/alerts-service"; | ||
import { DOWNLOAD_EVENT, DOWNLOAD_FINISHED_EVENT } from "../../alerts/constants/events"; | ||
|
||
export default class DownloadAlertsService extends AlertsService { | ||
onDownload(callback) { | ||
this.on(DOWNLOAD_EVENT, callback); | ||
} | ||
|
||
onDownloadFinished(callback) { | ||
this.on(DOWNLOAD_FINISHED_EVENT, callback); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
module.exports = { | ||
UPLOAD_EVENT: "upload", | ||
UPLOAD_FINISHED_EVENT: "upload:finished", | ||
DOWNLOAD_EVENT: "download", | ||
DOWNLOAD_FINISHED_EVENT: "download:finished", | ||
}; |
Oops, something went wrong.