I just got into redux-saga and I'm a bit confused on Watchers and Generators
Take for example this code below, that is the entry-point of my sagas file
function* employeesSaga() {
yield all([
takeEvery(getType(employeeActions.login.request), handleLoginRequest),
takeEvery(getType(employeeActions.verifyLogin.request), handleVerifyLoginRequest),
takeEvery(getType(employeeActions.logout), handleLogout)
]);
}
I am directly wiring each redux call to the corresponding handler.
But some people use watchers, and then they call the handler in that generator. What is the purpose of doing that? Should I use that pattern?
Also, I noticed some people wrap their entire handler with a while(true), is that necessary? Because my code works fine without that too...