Last active
April 5, 2021 20:47
-
-
Save bingex/af47d735b240bf2a556b3731d854b9b4 to your computer and use it in GitHub Desktop.
Watcher saga to stop upload request
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
import {takeEvery, fork, take} from 'redux-saga/effects'; | |
export default function* watcherSaga() { | |
while (true) { | |
const forkedTask = yield fork(uploadMediaWorker, yield take(types.UPLOAD_MEDIA)); | |
yield takeEvery(types.STOP_UPLOAD_MEDIA, stopUploadMediaWorker, forkedTask); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment