redux-saga project has been existing for a pretty long time now, but still there are a lot of confusing things about this library. And one of them is: how to start your rootSaga. For example, in the beginner tutorial rootSaga is started by yeilding an array of sagas. Like this
export default function* rootSaga() {
yield [
helloSaga(),
watchIncrementAsync()
]
}
However, in the using saga helpers section rootSaga consists of two forked sagas. Like this:
export default function* rootSaga() {
yield fork(watchFetchUsers)
yield fork(watchCreateUser)
}
The same way of starting rootSaga is used in async example in redux-saga repo. However, if you check real-world and shopping-card examples, you'll see that rootSagas there yeild an array of forked sagas. Like this:
export default function* root() {
yield [
fork(getAllProducts),
fork(watchGetProducts),
fork(watchCheckout)
]
}
Also, if you read some discussions in redux-saga issues, you'll see that some people suggest to use spawn instead of fork for rootSaga to guard you application from complete crashing if one of your forked sagas is canceled because of some unhandled exception.
So, which way is the most right way to start your rootSaga? And what are the differences between the existing ones?