Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function* asyncSellPostFetchWatcher() {
// use takeLatest instead of take every, so double click in short time will not trigger more fork
yield [
takeEvery('app/updateSellPost', requestUpdateSellPostAsync),
takeLatest('app/getSellPost', requestGetSellPostAsync),
takeLatest('app/getSellPosts', requestGetSellPostsAsync),
takeEvery('app/deleteSellPost', requestDeleteSellPostsAsync),
]
}
]
function* asyncLoginFetchWatcher() {
// use takeLatest instead of take every, so double click in short time will not trigger more fork
yield [
takeLatest('app/loginFacebook', requestLoginFacebookAsync),
takeLatest('app/loginGoogle', requestLoginGoogleAsync),
takeLatest('app/login', requestLoginAsync),
]
},
export default function * root () {
yield [
// some sagas only receive an action
takeLatest(StartupTypes.STARTUP, startup),
takeLatest(LoginTypes.LOGIN_REQUEST, login),
takeLatest(OpenScreenTypes.OPEN_SCREEN, openScreen),
// some sagas receive extra parameters in addition to an action
takeLatest(TemperatureTypes.TEMPERATURE_REQUEST, getTemperature, api)
]
}
function* sagaOfSaga(): Generator {
yield* takeLatest('Foo', saga0);
}
function* watchFetchMovieRecent() {
yield* takeLatest(ActionTypes.FETCH_MOVIE_RECENT_REQUEST, fetchMovieRecentSage)
}
function * pgpSaga (): SagaGenerator {
yield [
takeLatest(a => (a && a.type === Constants.updatePgpInfo && !a.error), checkPgpInfo),
takeLatest(Constants.generatePgp, generatePgpSaga),
takeEvery(Constants.dropPgp, dropPgpSaga),
]
}
export default function *rootSaga(client) {
yield [
takeLatest(GITHUB_HOTTEST_LOAD, loadHottestSaga, client)
];
}
export function* loginSucceedWatcher() {
yield* takeLatest(types.LOGIN_SUCCEED, loginSucceedSaga);
}