I'm using redux-saga and redux libraries to handle my project in React.
I'll explain my issue: in one moment the frontend application will dispatch n multiple identical saga "CUSTOM_ACTION" action (expected behaviour). Now I'd like to have only one api calls even the actions are multiple. Take latest option doesn't work.
This my saga code:
function* testWorker() {
// call api only once
}
function* testWatcher() {
yield takeLatest("CUSTOM_ACTION", testWorker);
}
With this configuration I have n api calls, one for each action.
How can I solve my problem?
Thanks in advance to everyone who can help me