rtfeldman/seamless-immutable

Compare equality of two immutable items

Open

#186 创建于 2016年12月15日

在 GitHub 查看
 (1 评论) (27 反应) (0 负责人)JavaScript (221 fork)batch import
enhancementhelp wanted

仓库指标

Star
 (5,367 star)
PR 合并指标
 (30 天内没有已合并 PR)

描述

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.

贡献者指南