rtfeldman/seamless-immutable

Compare equality of two immutable items

Open

#186 aberto em 15 de dez. de 2016

Ver no GitHub
 (1 comment) (27 reactions) (0 assignees)JavaScript (221 forks)batch import
enhancementhelp wanted

Métricas do repositório

Stars
 (5.367 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

This is essentially https://github.com/rtfeldman/seamless-immutable/issues/1, but am opening another issue for visibility as the prior is closed and there's no attention on it.

I'd like to have a method like Immutable.equals(a, b, deepWalk?) to compare if two objects are equal.

This is useful for perf optimization in React if I have a deeply nested object coming down (ignore best practices for props/how loaded an object should be going through to a component for the sake of argument here), where I can compare the new object to the current one in shouldComponentUpdate().

In some of my old components, I'm using immutable.js against the objects, and using the .equals() to compare them as part of a decision if the component should be updating or not.

Guia do colaborador