I'm cancelling a saga action when CANCEL_SEARCH is called:
function* cancelWorkerSaga(task) {
console.log(task);
yield cancel(task);
}
export default function* sagaFlights() {
const workerTask = yield takeLatest(GET_FLIGHTS, getFlights);
yield takeLatest(CANCEL_SEARCH, cancelWorkerSaga, workerTask);
}
The cancel action is working fine but when i navigate to home screen and tried to make a new search the getFlights actions is not being called anymore. What am i doing wrong?