rtfeldman/seamless-immutable

Compare equality of two immutable items

オープン

#186 opened on 2016/12/15

 (1 件のコメント) (27 件のリアクション) (0 人の担当者)JavaScript (221 件のフォーク)batch import
enhancementhelp wanted

Repository metrics

Stars
 (5,367 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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.

コントリビューターガイド