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

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -