You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem
When comparing two text nodes with Text.equals() , currently only text is omitted from the object when loose: true is provided. I want to compare two text nodes that will always have unique ids.
The alternative isn't really possible with the types
// @ts-ignore - I want to omit the id from the comparison but the function is expecting a complete TextNodeif(Text.equals(omitId(node),omitId(nextNode),{loose: true})){Transforms.mergeNodes(editor,{at: nextPath})}
Problem
When comparing two text nodes with
Text.equals()
, currently only text is omitted from the object whenloose: true
is provided. I want to compare two text nodes that will always have unique ids.Solution
I'm thinking of two possible solutions depending on the appetite of everyone.
isDeepEqual
function from utils underlying theText.equals
check and let me roll my own equality functionor
Text.equals
function allowing me to pass in my own omission function something likeAlternatives
I just run my own
omit
function on the nodes before I pass them into theequals
function 🤔The text was updated successfully, but these errors were encountered: