本文整理汇总了TypeScript中redux-saga/effects.takeEvery函数的典型用法代码示例。如果您正苦于以下问题:TypeScript takeEvery函数的具体用法?TypeScript takeEvery怎么用?TypeScript takeEvery使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了takeEvery函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: authSaga
export default function* authSaga() {
yield takeEvery(AUTH_LOGIN.type, authLoginWorker)
yield takeEvery(AUTH_REGISTER.started.type, authRegisterSaga)
yield takeEvery(AUTH_LOGOUT.started.type, authLogoutSaga)
yield takeEvery(AUTH_TOKEN.started.type, authTokenSaga)
yield takeEvery([AUTH_TOKEN.failed.type, AUTH_UNAUTHENTICATED.type], removeToken)
}
示例2: watchPersonal
export default function* watchPersonal () {
yield all([
takeLatest('personal/daily', syncDailyRecommend),
takeEvery('personal/playlist/create', createPlaylist),
takeEvery('personal/playlist/delete', deletePlaylist),
takeEvery('personal/playlist', syncPersonnalPlaylist)
])
}
示例3: root
export function * root () {
yield all([
takeEvery(REBOOT, reboot),
takeEvery(RESET, reset),
takeEvery(USER_PLACE_CHESS, userPlaceChess),
takeEvery(SWITCH_PLAYER, switchPlayer)
])
}
示例4: watchFetchBranchesAndCommits
export function* watchFetchBranchesAndCommits() {
yield takeEvery(String(fetchRepoBranches), handleFetchBranches);
yield takeEvery(String(fetchRepoCommits), handleFetchCommits);
yield takeLatest(String(fetchFile), handleFetchFile);
yield takeEvery(String(fetchDirectory), handleFetchDirs);
yield takeLatest(String(fetchTreeCommits), handleFetchTreeCommits);
yield takeLatest(String(fetchMoreCommits), handleFetchMoreCommits);
}
示例5: summarySaga
export function* summarySaga(): any {
yield all([
takeEvery(QUERY_SUMMARY, querySummaryDeal),
takeEvery(MODIFY_SUMMARY, modifySummaryDeal),
fork(refreshSummaryDeal),
]);
}
示例6: rootSaga
export default function* rootSaga () {
yield all([
takeEvery('search/query', requestSearch),
takeEvery('search/activeTab', requestSearch),
fork(syncSearchSongs),
fork(syncSearchPlaylists),
fork(syncSearchArtist),
fork(syncSearchAlbums)
])
}
示例7: tagsSaga
export function* tagsSaga(): any {
yield all([
takeEvery(QUERY_WIKI_TAGS, queryTagsDeal),
takeEvery(ADD_WIKI_SPECTAG, addTagDeal),
takeEvery(DEL_WIKI_SPECTAG, deleteTagDeal),
takeEvery(CHANGE_WIKI_SPEC_TAG, changeTagDeal),
fork(refreshTagsDeal),
]);
}
示例8: watchDownload
export default function* watchDownload () {
yield all([
takeEvery('download/tracks', downloadTracksSaga),
takeEvery('download/tracks/merge', mergeTracksSaga),
takeEvery('download/tracks/set', setTracksSaga),
takeLatest('download/stop', stopCurrentDownloadSaga),
takeLatest('download/clear', clearAllDownload),
takeEvery('download/tracks/delete', deleteDownloadTrackSaga)
])
}
示例9: test
test('mainSaga', () => {
testSaga(mainSaga)
.next()
.all([
takeEvery('comments/sync', syncComments),
takeEvery('comments/more', syncMoreComments)
])
.next()
.isDone()
})
示例10: testChannelTakeEvery
function* testChannelTakeEvery(): SagaIterator {
// typings:expect-error
yield takeEvery(channel);
// typings:expect-error
yield takeEvery(channel, (action: Action) => {});
yield takeEvery(channel, (action: {someField: string}) => {});
// typings:expect-error
yield takeEvery(channel, (a: 'a', action: {someField: string}) => {});
// typings:expect-error
yield takeEvery(channel, (a: 'a', action: {someField: string}) => {}, 1);
yield takeEvery(channel, (a: 'a', action: {someField: string}) => {}, 'a');
// typings:expect-error
yield takeEvery(channel, (action: {someField: string}) => {}, 1);
// typings:expect-error
yield takeEvery(channel,
(a: 'a', b: 'b', c: 'c', d: 'd', e: 'e', f: 'f', g: 'g',
action: {someField: string}) => {},
1, 'b', 'c', 'd', 'e', 'f', 'g'
);
yield takeEvery(channel,
(a: 'a', b: 'b', c: 'c', d: 'd', e: 'e', f: 'f', g: 'g',
action: {someField: string}) => {},
'a', 'b', 'c', 'd', 'e', 'f', 'g'
);
}