'listener for changes in react native
Good evening everyone . I am developing a react native app by interfacing to a database via endpoint (specifically aws). Now on loading the dashboard I retrieve this data via API , save it in local storage and show it to the user. Now from the management system, there could be some changes to this data that I show on the app, so what I was interested in knowing was if it was possible to create a sort of listener that calls my API whenever there are changes in the DB. I ask this because I would like to avoid calling the API every time a user lands on the dashboard and I would like to avoid calling the API every XXX minutes if there is no reason (if the data has not changed). Is there any way to create an event listener? It would also be enough for me to be directed on what exactly to look for. Thanks in advance for your availability
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
