Last active
May 6, 2018 07:27
-
-
Save puemos/88804847c32e24d9eed0e1efd8c398d2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// the first to fire between "all done" and "cancel" | |
const { cancelDownload, allDone } = yield race({ | |
allDone: take(allDoneChannel), | |
cancelDownload: take("CANCEL_DOWNLOAD") | |
}); | |
// stop the queue manager | |
yield cancel(watcherTask); | |
// in case of cancellation just return; | |
if (cancelDownload){ | |
return; | |
} | |
// in case of "all done" create a link and put a new action | |
if (allDone) { | |
const link = URL.createObjectURL(blobBuilder.build()); | |
yield put(downloadFinished({ id, link })); | |
return; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment