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
console.warn(`[legend-state] Set an HTMLElement into state. You probably don't want to do that.`);
If so, I'd like to understand why (I have seemingly legitimate use cases for wanting HTMLElement references in my state). And if not then I'd vote for not issuing the warning if the element is properly wrapped.
Thanks.
The text was updated successfully, but these errors were encountered:
conststore$=observable<{element: null|HTMLElement}>({element: null})store$.element.set(ObservableHint.opaque(element))// causes warning here
You might be correct since opaque defines a new property with a Symbol on the passing value to prevent setting listeners on it later. This warning only checks if the passing value is an instance of HTMLElement; it should also check if it has the opaque symbol property.
Is this warning still relevant when you wrap the
HTMLElement
inObservableHint.opaque
?legend-state/src/ObservableObject.ts
Line 675 in 2a07e5e
If so, I'd like to understand why (I have seemingly legitimate use cases for wanting HTMLElement references in my state). And if not then I'd vote for not issuing the warning if the element is properly wrapped.
Thanks.
The text was updated successfully, but these errors were encountered: