H
H
Herberito Galustyan2019-08-03 20:36:15
React
Herberito Galustyan, 2019-08-03 20:36:15

What is the difference between these two kinds of rootSaga configuration?

the code below is a trial version of rootSaga in redux-saga
Can anyone tell me the difference?

// kind 1
export default function* rootProjectSaga (): IterableIterator<any> {  
  yield all([
    takeEvery(TRANSFER_PROJECT, transferProject as any),
    takeLatest(LOAD_PROJECTS, getProjects as any)    
  ])
}
// kind 2
export default function* rootProjectSaga (): IterableIterator<any> { 
  yield  takeEvery(TRANSFER_PROJECT, transferProject as any)
  yield  takeLatest(LOAD_PROJECTS, getProjects as any)   
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
myaca, 2019-08-03
@myaca

1 case
> effects will get executed in parallel
2 case
> effects will be executed in sequence
https://redux-saga.js.org/docs/advanced/RunningTas... =)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question