S
S
symnoob2019-03-07 11:38:05
React Native
symnoob, 2019-03-07 11:38:05

Is there something like Event Listener, Event Subscriber in React Native?

Good afternoon,
I started a project on React Native. In general, this is a simple API application.
So I wondered if there is something like Event Listener, Event Subscriber in React Native?
That is, I make a request, if my API Token is invalid, then it simply sends for authorization and erases the old API Token from asyncstorage.
To prescribe the same thing in each request is somehow not very (DRY).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew, 2019-05-01
@symnoob

redux middleware should help you, where you will check this for all api actions, this is of course if redux is used, if not, then you write a function that you use throughout the project.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question