Do you want to request a feature or report a bug?
This is a question.
What is the current behavior?
What is the best way to compare ContentStates? I understand that ContentState is an Immutable Record, so part of its charm should be its #equals() method. I was hoping to be able to compare ContentStates to see whether data needed to be synced remotely. I'm not sure how to do this.
It appears that ContentStates aren't actually comparable in the Immutable sense. For example, suppose:
var raw = convertToRaw(state)
var state1 = convertFromRaw(raw)
var state2 = convertFromRaw(raw)
Now, not only is state1.equals(state2) === false, but also state1.getBlockMap().equals(state2.getBlockMap()) === false.
And the entityMap, which is currently in the process of being transitioned to the Immutable API as I understand it, is currently not Immutable and therefore not comparable.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. You can use this jsfiddle to get started: https://jsfiddle.net/stopachka/m6z0xn4r/.
What is the expected behavior?
Which versions of Draft.js, and which browser / OS are affected by this issue? Did this work in previous versions of Draft.js?
Yes,
var state1 = convertFromRaw(raw)
var state2 = convertFromRaw(raw)
state1.getBlockMap().equals(state2.getBlockMap()) // false
but that's okay?
Most helpful comment
Yes,
but that's okay?