The problem: i have many sagas that do not handle an 401 error in response status, and now i have to deal with it. I have apiservice based on apisause and i can write an response monitor with it to handle 401 error (like interceptors in axios). But i cant dispatch any action to store to reset user data, for example, because there is no store context in apiservice. How to use dispatch function in apiservice layer? Or use put() function in every saga when i recieve 401 response status is the only right way?
Handle 401 error in react-redux app using apisauce
432 Views Asked by tzi0 At
1
There are 1 best solutions below
Related Questions in REDUX
- How to split routes to different files with Redux and React-router?
- redux-saga, TypeError: (0 , _effects.takeLatest) is not a function?
- Expose Redux store api using webpack instead of global
- Using the Angular 2 Http client in order to rehydrate application state in a ngrx meta reducer
- Redux-thunk dispatch is not a function
- show 10 results per page
- Replicating the action on redux-thunk to redux-saga
- redux-saga: tracking multiple async tasks
- Redux saga, rx-observable. With vanilla fetch calls, why the need over thunks?
- Handling many entities on Redux without repetition
- React Native & Redux props correct design pattern
- React native + redux-persist: how to ignore keys (blacklist)?
- How to cancel execution of a previous action upon a new action?
- What is the use of the ownProps arg in mapStateToProps and mapDispatchToProps?
- Concat actually concatenates instead of adds to array. React Native Javascript
Related Questions in SAGA
- Correlating aggregates by Saga ID instead of an additional aggregate root
- redux-saga: tracking multiple async tasks
- Multiple distributed event stores for data governance working together
- Unit testing redux-saga task cancellation
- Can i implement timetolive on nservicebus sagas?
- NServiceBus SagaData persistance issue with NHibernate around List<string>
- Is it possible to lock affinity of a MassTransit saga to a given consumer?
- NServiceBus saga not handling messages on azure
- NServiceBus Use 4.0 Handler in 2.6 saga
- Nservice bus saga ordering
- Error on Customers Service while consuming (Order Service generated) message
- DDD Relate Aggregates in a long process running
- Architecture concerns using minimal aggregates in a long running transaction
- Can a MassTransit Consumer Saga be InitiatedBy the same message(s) that it Orchestrates?
- Waiting for multiple actions before proceeding in redux-saga
Related Questions in APISAUCE
- how to fix network error on Apisauce when coonecting with backend
- How do i pass a bearer authorization token with ApiSauce
- NETWORK_ERROR apisauce
- GET request to download PDF using apisauce in react native
- How can I download the pdf file using apisauce in React Native?
- Getting JSON info from API
- OnUploadProgress is only called once
- How do you type hint overriding a built in axios method that returns a promise?
- Not able to install apisauce in react-native project
- Is axios convert 0 to null in response?
- Can't fetch my data from my backend(NodeJS) to my react native app
- Apisauce interceptor
- How to solve image data response as null in react native when using zoho image fetching api?
- https doesnt work on react-native android
- React Native API Request slow on production but fast on development
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
you can use refs for using navigation in 'apisauce' interceptors this is my code and it works for me ;)
I have a main file for create apisauce
// file _api.js :
and is file interceptors.js I'm watching on responses and manage them:
// file interceptors.js
then I create another file and named to 'RootNavigation.js' and create a ref from react-native-navigation:
// file RootNavigation.js
then you should to set some changes in you App.js file:
finally in anywhere you can call this function for use react native navigations
full focument is in here that explain how to Navigating without the navigation prop
Navigating without the navigation prop