本文整理汇总了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);
}
示例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),
]
}
示例3: watchRecommend
export default function* watchRecommend () {
yield all([
takeLatest('home/recommend', recommendSaga),
takeLatest('home/albums', syncMoreAlbums),
takeLatest('home/artists', syncMoreArtists)
])
}
示例4: watchAlbums
export default function* watchAlbums () {
yield all([
takeLatest('albums/refresh', refreshAlbums),
takeLatest('albums/sync', syncMoreAlbums),
takeEvery('albums/detail', syncAlbum)
])
}
示例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);
}
示例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),
]);
}
示例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)
])
}
示例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'
);
}
示例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)
])
}
示例10: test
test('main saga', () => {
testSaga(mainSaga)
.next()
.all([
takeLatest('home/recommend', recommendSaga),
takeLatest('home/albums', syncMoreAlbums),
takeLatest('home/artists', syncMoreArtists)
])
.next()
.isDone()
})
示例11: test
test('main saga', () => {
testSaga(mainSaga)
.next()
.all([
takeLatest('albums/refresh', refreshAlbums),
takeLatest('albums/sync', syncMoreAlbums),
takeEvery('albums/detail', syncAlbum)
])
.next()
.isDone()
})
示例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);
}
示例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)
])
}
示例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()
})
示例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);
}