當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript effects.takeEvery函數代碼示例

本文整理匯總了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)
}
開發者ID:nikteg,項目名稱:loud,代碼行數:7,代碼來源:auth.ts

示例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)
  ])
}
開發者ID:czb128abc,項目名稱:gouqi,代碼行數:8,代碼來源:personal.ts

示例3: root

export function * root () {
  yield all([
    takeEvery(REBOOT, reboot),
    takeEvery(RESET, reset),
    takeEvery(USER_PLACE_CHESS, userPlaceChess),
    takeEvery(SWITCH_PLAYER, switchPlayer)
  ])
}
開發者ID:DanSnow,項目名稱:react-reversi,代碼行數:8,代碼來源:saga.ts

示例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);
}
開發者ID:elastic,項目名稱:kibana,代碼行數:8,代碼來源:file.ts

示例5: summarySaga

export function* summarySaga(): any {
	yield all([
		takeEvery(QUERY_SUMMARY, querySummaryDeal),
		takeEvery(MODIFY_SUMMARY, modifySummaryDeal),

		fork(refreshSummaryDeal),
	]);
}
開發者ID:weiweiwitch,項目名稱:third-lab,代碼行數:8,代碼來源:summary.ts

示例6: rootSaga

export default function* rootSaga () {
  yield all([
    takeEvery('search/query', requestSearch),
    takeEvery('search/activeTab', requestSearch),
    fork(syncSearchSongs),
    fork(syncSearchPlaylists),
    fork(syncSearchArtist),
    fork(syncSearchAlbums)
  ])
}
開發者ID:czb128abc,項目名稱:gouqi,代碼行數:10,代碼來源:search.ts

示例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),
	]);
}
開發者ID:weiweiwitch,項目名稱:third-lab,代碼行數:10,代碼來源:tags.ts

示例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)
  ])
}
開發者ID:czb128abc,項目名稱:gouqi,代碼行數:10,代碼來源:download.ts

示例9: test

test('mainSaga', () => {
  testSaga(mainSaga)
    .next()
    .all([
      takeEvery('comments/sync', syncComments),
      takeEvery('comments/more', syncMoreComments)
    ])
    .next()
    .isDone()
})
開發者ID:czb128abc,項目名稱:gouqi,代碼行數:10,代碼來源:comment.test.ts

示例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'
  );
}
開發者ID:liesislukas,項目名稱:redux-saga,代碼行數:29,代碼來源:effects.ts


注:本文中的redux-saga/effects.takeEvery函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。