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


TypeScript effects.takeLatest函數代碼示例

本文整理匯總了TypeScript中redux-saga/effects.takeLatest函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript takeLatest函數的具體用法?TypeScript takeLatest怎麽用?TypeScript takeLatest使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了takeLatest函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: GisSaga

export default function* GisSaga() {
	yield takeLatest(GisTypes.INITIALISE_MAP, initialiseMap);
	yield takeLatest(GisTypes.ADD_SOURCE, addSource);
	yield takeLatest(GisTypes.REMOVE_SOURCE, removeSource);
	yield takeLatest(GisTypes.RESET_SOURCES, resetSources);
	yield takeLatest(GisTypes.RESET_MAP, resetMap);
}
開發者ID:3drepo,項目名稱:3drepo.io,代碼行數:7,代碼來源:gis.sagas.ts

示例2: takeLatest

 return function*(): IterableIterator<ReadonlyArray<ForkEffect>> {
   yield [
     takeLatest(Actions.SignIn.SIGN_IN_SUCCESS, GetApiTokens),
     takeLatest(Actions.SignUp.SIGN_UP_SUCCESS, GetApiTokens),
     takeLatest(Actions.SetTokenLogin.SET_TOKEN_LOGIN, GetApiTokens),
   ]
 }
開發者ID:aconly,項目名稱:frost-web,代碼行數:7,代碼來源:GetApiTokens.saga.ts

示例3: watchRecommend

export default function* watchRecommend () {
  yield all([
    takeLatest('home/recommend', recommendSaga),
    takeLatest('home/albums', syncMoreAlbums),
    takeLatest('home/artists', syncMoreArtists)
  ])
}
開發者ID:czb128abc,項目名稱:gouqi,代碼行數:7,代碼來源:recommend.ts

示例4: watchAlbums

export default function* watchAlbums () {
  yield all([
    takeLatest('albums/refresh', refreshAlbums),
    takeLatest('albums/sync', syncMoreAlbums),
    takeEvery('albums/detail', syncAlbum)
  ])
}
開發者ID:czb128abc,項目名稱:gouqi,代碼行數:7,代碼來源:album.ts

示例5: 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

示例6: rootSaga

export default function* rootSaga() {
  yield call(restoreSettings);
  yield all([
    takeLatest(Actions.Commit, commitSettings),
    debounce(toastDebounce, Actions.UpdateFeedConfiguration, commitSettings),
    debounce(toastDebounce, Actions.UpdatePanelConfiguration, commitSettings),
    debounce(toastDebounce, Actions.UpdatePanelType, commitSettings),
    takeLatest(Actions.Committed, settingsStoredToast),
  ]);
}
開發者ID:tylerFowler,項目名稱:chrome-dashboard,代碼行數:10,代碼來源:sagas.ts

示例7: 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

示例8: testChannelTakeLatest

function* testChannelTakeLatest(): SagaIterator {
  // typings:expect-error
  yield takeLatest(channel);

  // typings:expect-error
  yield takeLatest(channel, (action: Action) => {});
  yield takeLatest(channel, (action: {someField: string}) => {});
  // typings:expect-error
  yield takeLatest(channel, (a: 'a', action: {someField: string}) => {});
  // typings:expect-error
  yield takeLatest(channel, (a: 'a', action: {someField: string}) => {}, 1);
  yield takeLatest(channel, (a: 'a', action: {someField: string}) => {}, 'a');

  // typings:expect-error
  yield takeLatest(channel, (action: {someField: string}) => {}, 1);

  // typings:expect-error
  yield takeLatest(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 takeLatest(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

示例9: watchArtists

export default function* watchArtists () {
  yield all([
    takeLatest('artists/refresh', refreshArtists),
    takeLatest('artists/sync', syncMoreArtists),
    takeLatest('artists/detail/follow', toggleSubscribeArtist),
    takeLatest('artists/favo', favorites),
    takeEvery('artists/detail/track', syncArtistTracks),
    takeEvery('artists/detail/album', syncArtistAlbums),
    takeEvery('artists/detail/description', syncArtistDescription)
  ])
}
開發者ID:czb128abc,項目名稱:gouqi,代碼行數:11,代碼來源:artist.ts

示例10: test

test('main saga', () => {
  testSaga(mainSaga)
    .next()
    .all([
      takeLatest('home/recommend', recommendSaga),
      takeLatest('home/albums', syncMoreAlbums),
      takeLatest('home/artists', syncMoreArtists)
    ])
    .next()
    .isDone()
})
開發者ID:czb128abc,項目名稱:gouqi,代碼行數:11,代碼來源:recommend.test.ts

示例11: test

test('main saga', () => {
  testSaga(mainSaga)
    .next()
    .all([
      takeLatest('albums/refresh', refreshAlbums),
      takeLatest('albums/sync', syncMoreAlbums),
      takeEvery('albums/detail', syncAlbum)
    ])
    .next()
    .isDone()
})
開發者ID:czb128abc,項目名稱:gouqi,代碼行數:11,代碼來源:album.test.ts

示例12: ModelSaga

export default function* ModelSaga() {
	yield takeLatest(ModelTypes.FETCH_SETTINGS, fetchSettings);
	yield takeLatest(ModelTypes.FETCH_META_KEYS, fetchMetaKeys);
	yield takeLatest(ModelTypes.UPDATE_SETTINGS, updateSettings);
	yield takeLatest(ModelTypes.FETCH_REVISIONS, fetchRevisions);
	yield takeLatest(ModelTypes.DOWNLOAD_MODEL, downloadModel);
	yield takeLatest(ModelTypes.UPLOAD_MODEL_FILE, uploadModelFile);
	yield takeLatest(ModelTypes.ON_MODEL_STATUS_CHANGED, onModelStatusChanged);
	yield takeLatest(ModelTypes.SUBSCRIBE_ON_STATUS_CHANGE, subscribeOnStatusChange);
	yield takeLatest(ModelTypes.UNSUBSCRIBE_ON_STATUS_CHANGE, unsubscribeOnStatusChange);
	yield takeLatest(ModelTypes.FETCH_MAPS, fetchMaps);
}
開發者ID:3drepo,項目名稱:3drepo.io,代碼行數:12,代碼來源:model.sagas.ts

示例13: watchPlaylist

export default function* watchPlaylist () {
  yield all([
    fork(syncPlaylistDetail),
    fork(subscribePlaylist),
    fork(popupTrackActionSheet),
    fork(popupCollectActionSheet),
    fork(collectTrackToPlayliast),
    fork(toCommentPage),
    fork(toCreatePlaylistPage),
    takeLatest('playlists/refresh', refreshPlaylist),
    takeLatest('playlists/sync', syncPlaylists)
  ])
}
開發者ID:czb128abc,項目名稱:gouqi,代碼行數:13,代碼來源:playlist.ts

示例14: test

test('mainSaga', () => {
  testSaga(mainSaga)
    .next()
    .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)
    ])
    .next()
    .isDone()
})
開發者ID:czb128abc,項目名稱:gouqi,代碼行數:14,代碼來源:download.test.ts

示例15: ViewpointsSaga

export default function* ViewpointsSaga() {
	yield takeLatest(ViewpointsTypes.FETCH_VIEWPOINTS, fetchViewpoints);
	yield takeLatest(ViewpointsTypes.CREATE_VIEWPOINT, createViewpoint);
	yield takeLatest(ViewpointsTypes.UPDATE_VIEWPOINT, updateViewpoint);
	yield takeLatest(ViewpointsTypes.DELETE_VIEWPOINT, deleteViewpoint);
	yield takeLatest(ViewpointsTypes.SHOW_VIEWPOINT, showViewpoint);
	yield takeLatest(ViewpointsTypes.SET_CAMERA_ON_VIEWPOINT, setCameraOnViewpoint);
	yield takeLatest(ViewpointsTypes.SUBSCRIBE_ON_VIEWPOINT_CHANGES, subscribeOnViewpointChanges);
	yield takeLatest(ViewpointsTypes.UNSUBSCRIBE_ON_VIEWPOINT_CHANGES, unsubscribeOnViewpointChanges);
	yield takeLatest(ViewpointsTypes.PREPARE_NEW_VIEWPOINT, prepareNewViewpoint);
}
開發者ID:3drepo,項目名稱:3drepo.io,代碼行數:11,代碼來源:viewpoints.sagas.ts


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