Pagination on Variant types. #1291
-
Hi team, We are trying to extend our custom pagination (detailed #1206) to all the Our paginated structure has been modified to -
On extending this concept to a variant on the user model, it works when we pass the Primary variant/base model as the object ref.
Concern/Question - Could you let us know if this is the right approach? If yes, can you please explain why the object ref takes in the primary variant and returns an additional variant (without the type checker complaining). Thank you in advance for you time and help. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It is likely that the data requirements for both variants are the same. Typescript uses structural typing, so if 2 types have all the same properties, they can be used interchangeably without any type errors. I'd have to see the definitions of |
Beta Was this translation helpful? Give feedback.
It is likely that the data requirements for both variants are the same. Typescript uses structural typing, so if 2 types have all the same properties, they can be used interchangeably without any type errors.
I'd have to see the definitions of
UserVariant
andUser
to know for sure