当前位置: 首页>>代码示例>>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;未经允许,请勿转载。