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
The current rx-virtual-for directive lacks support for the DataSource interface, which is available in Angular CDK's CdkVirtualForOf (https://material.angular.io/cdk/scrolling/overview#specifying-data).
This limitation restricts users who want to leverage existing DataSource implementations or need more complex data handling scenarios in virtual scrolling, without introducing further boilerplate code.
We are currently migrating to rx-angular to improve the responsiveness of our tool. Having native support for taking in a DataSource would help us reducing necessary boilerplate when using it in combination with the rx virtual for directive.
Solution
Implement support for the DataSource interface in rx-virtual-for, aligning with Angular CDK's implementation while maintaining rx-angular's reactive approach and perks.
The solution includes:
Adding DataSource as a valid input type for rxVirtualForOf directive
Implementing logic for connecting to and disconnecting from the DataSource with the lifecycle of the virtual for
Pass the ListRange changes directly to the connect method of the DataSource so taht the appropriate data from the DataSource can be fetched/handled and be returned to the virtual for directive
Provide a seamless integration for users to utilize their existing DataSource implementations
As the rx virtual for directive already exposes the viewRange: ListRange hook, it is possible to implement the angular cdk CollectionViewer interface on the component that uses the rx virtual for directive and then connect the viewRange: Subject exposed from the rx virtual for to the viewChange: Observable, handle connect/disconnect to and from the data source manually with the lifecycle of the component.
And even tho it is possible and we are currently using it, as rx-virtual-for is a good alternative to the cdk virtual scrolling, this might be a missed opportunity to align with the existing Angular patterns and limits compatibility.
Additional Context
This addition acknowledges that while the feature isn't critical, it would be beneficial based on real-world use cases and would enhance the overall functionality of rx-virtual-for.
BR,
Vincent
The text was updated successfully, but these errors were encountered:
Problem Solved By The Feature
The current rx-virtual-for directive lacks support for the DataSource interface, which is available in Angular CDK's CdkVirtualForOf (https://material.angular.io/cdk/scrolling/overview#specifying-data).
This limitation restricts users who want to leverage existing DataSource implementations or need more complex data handling scenarios in virtual scrolling, without introducing further boilerplate code.
We are currently migrating to rx-angular to improve the responsiveness of our tool. Having native support for taking in a DataSource would help us reducing necessary boilerplate when using it in combination with the rx virtual for directive.
Solution
Implement support for the DataSource interface in rx-virtual-for, aligning with Angular CDK's implementation while maintaining rx-angular's reactive approach and perks.
The solution includes:
I created a small PR proposal here #1764
Alternatives Considered
As the rx virtual for directive already exposes the viewRange: ListRange hook, it is possible to implement the angular cdk CollectionViewer interface on the component that uses the rx virtual for directive and then connect the viewRange: Subject exposed from the rx virtual for to the viewChange: Observable, handle connect/disconnect to and from the data source manually with the lifecycle of the component.
And even tho it is possible and we are currently using it, as rx-virtual-for is a good alternative to the cdk virtual scrolling, this might be a missed opportunity to align with the existing Angular patterns and limits compatibility.
Additional Context
This addition acknowledges that while the feature isn't critical, it would be beneficial based on real-world use cases and would enhance the overall functionality of rx-virtual-for.
BR,
Vincent
The text was updated successfully, but these errors were encountered: