javascript - Keep a list of ids in Redux store -
storing redux objects in store key/id makes them better lookup, more modified, deleted, etc. it's more efficient.
entities: { 3f9kwr2: { first: 'john' last: 'johnson' }, zyr4oll: { first: 'tina' ...
i have noticed many people storing list of ids
in reducer (example). in case above, array ['3f9kwr2', 'zyr4oll']
.
this redux recipe suggests keeping list of ids solely keep original order of data (how ordered in api response, example). if keeping original order not important, storing list of ids server purpose?
no, not serve purpose. list of ids can retrieved in example object.keys(state.entities)
, except know nothing order. if not care order, there no difference between doing , maintaining separate list of ids.
Comments
Post a Comment