I’m implementing a react hook wrapping “ResizeObserver”.
If I’m understanding ResizeObserver correctly you create an instance passing a callback that receives an array of ResizeObserverEntry’s
You then have to call the instance “observe” method and pass it an element to be observed.
The hook should create a single instance internally and call the appropriate callbacks for each hook use.
The thing is that I think I can’t escape having to compare the DOM element passed in the observe method to some data structure holding the element’s passed to the hook itself so…
Long story short…
What’s the proper way of comparing objects (for equality) in rescript?
Is there a data structure that can hold object references as keys?