Closed saskliutas closed 6 months ago
Latest commit: 093fc926ebc8e757a04f660319feba6bddd9f7ac
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Added workaround to make sure that we always report initial tree load. This was happening because of how node loads are scheduled and that observable that loads nodes and adds them into model event if outside subscribers are all unsubscribed. Scheduler always waits until completion if load was started. This leads to the situation like this:
To workaround this ReportingTreeNodeLoader never unsubscribes from observable loading root nodes. This makes implementation simple and does not require additional changes in
@itwin/components-react
. It works on assumption that root nodes will be always first request when tree is rendered and scheduler will immediately subscribes to it and also does not unsubscribe until nodes are loaded.Also updated ReportingTreeNodeLoader to better handle multiple subscribers/unsubscribers by ref counting.