DEV Community

Mariusz
Mariusz

Posted on • Edited on

2

React tldr; Why you should use an object, and not an array, for lists in Redux

  • With object solution you won't get duplicated items.
  • Using an object will save your future self some time and bugs.
  • CRUD operations do not iterate over all items each time.
  • If you need an array of items, just add selector that will convert object to array.

Source: https://medium.com/javascript-in-plain-english/https-medium-com-javascript-in-plain-english-why-you-should-use-an-object-not-an-array-for-lists-bee4a1fbc8bd

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay