dimanche 6 mai 2018

Thinking in Redux

Im trying to understand redux while designing a sample App. Im confused with the concept of state vs data model.

Note: Im not using Reactjs.

Background of the Sample App.

2 tabular grids:

Grid A: List of members on my website.

Grid B: List of all orders by a member, selected in Grid A.

  • So the end-user of this app, can select only 1 member at a time from Grid A at a time.
  • The end user can also enter name of user in Grid A and my backend service will return the details for this member (for grid A) & all their past orders(Grid B).

Redux Questions

  1. My backend service knows nothing about the order in which I list items in Grid A or B. Who should maintain order of items in the Grid? Is it responsibility of the store or the component?

  2. Who maintains which member is clicked in Grid A? ? My backend service, returns me all the members and all their orders. It knowns nothing about the member that is selected on the UI.

Is it good practice, to have components keep this information and then augment the UI, whenever it refreshes from the data it gets from the store?

Aucun commentaire:

Enregistrer un commentaire