I am trying to develop an app using React Native, Redux and Redux Saga.
I have the following login flow:
I have multiple containers and components which each execute actions which in turn have sagas doing API calls. What would be the correct way to pass the token from the store to the API calling method while keeping the code clean and reusable.
You can create API saga(s) which will process all API actions from other app sagas. Use select
effect here to get token from the store and pass it to API Call
. Keep API Call
separated from this saga for more abstraction and DRY principle. There are several options to call this saga: direct with yield*
or by throwing redux action.