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
I'm working on a table that I would like to use to display a variety of data, all derived from a base class. Some things work out of the box, like typing data: BaseClass. Some things need lots of userland type-guarding that I think could move into the framework.
In my example, I have ownership relationships modeled as .has on specific levels of my type hierarchy. I am able to say
which is effective at runtime to filter to only elements of my data which are of these specific levels. However, in my column definition, when I guard with row.getCanExpand and check what type row is, it's still BaseClass. It would be great to let the type narrowing applied by getRowCanExpand flow through to getCanExpand.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm working on a table that I would like to use to display a variety of data, all derived from a base class. Some things work out of the box, like typing
data: BaseClass
. Some things need lots of userland type-guarding that I think could move into the framework.In my example, I have ownership relationships modeled as
.has
on specific levels of my type hierarchy. I am able to saywhich is effective at runtime to filter to only elements of my data which are of these specific levels. However, in my column definition, when I guard with
row.getCanExpand
and check what typerow
is, it's stillBaseClass
. It would be great to let the type narrowing applied bygetRowCanExpand
flow through togetCanExpand
.Beta Was this translation helpful? Give feedback.
All reactions