The Architecture - Deepstash

The Architecture

To implement the concepts presented above, you need some help from libraries like Redux-Persist and Netinfo. Redux-Persist will help when launching the app, to populate the Redux with data from the previous session, checking the black and white lists. Netinfo can be used to check the status of the network connection.

STASHED IN:

3

MORE IDEAS FROM THE ARTICLE

  1. The user should be notice if the app si offline and be informed in a screen if that feature is not available
  2. The offline features should be synced with the server once back online

STASHED IN:

3

If there is no internet connection, the data should be extracted from the local storage. Otherwise, a fetch request will be made, including a timestamp, with the last sync with the server. The server will than reply with the updated data and the timestamp will be updated, representing a checkpoint.

STASHED IN:

3

When back online, you should sync the server with the offline actions. To do so, you should maintain a queue with all the API requests, for executing when the connection will be restored. This queue should be persisted in redux, to remain after several offline sessions

2

STASHED IN:

3

When trying to make a POST, the local state should be updated and Redux should check the internet connection, to see if should make the api request or add it to the queue.

Notice: The modified data should be persisted, so there won't be any discrepancies between sessions

STASHED IN:

3

Deepstash helps you become inspired, wiser and productive, through bite-sized ideas from the best articles, books and videos out there.

GET THE APP:

RELATED IDEAS

Testing in React Native

As your codebase expands, small errors and edge cases you don’t expect can cascade into larger failures. Bugs lead to bad user experience and ultimately, business losses. One way to prevent fragile programming is to test your code before releasing it into the wild.

There is more value in testing than you might realize. One of the best ways to fix a bug in your code is to write a failing test that exposes it. Then when you fix the bug and re-run the test, if it passes it means the bug is fixed, never reintroduced into the code base.

4

STASHED IN:

7

STASHED IN:

0 Comments

The Primary Relationship of Personal Heroism

Our relationship with our work, our money, customers, peers, colleagues, clients and even our productivity depends on one primary relationship: The personal relationship we have with ourselves.

Every other external relation will rise, evolve and transform if we tend to this primary relationship of personal heroism.

STASHED IN:

35

Potential Unexpressed Turns Into Pain

If you want to learn and grow, and lift, and expand, we need to stop doing stuff like playing games, or wasting time on our smartphones, as that is only a life of mediocrity.

We betray our genius, welling up the psychic pain inside us and start to disrespect ourselves when we hide our true potential and just tolerate life.

1

STASHED IN:

154