Skip to content

Commit

Permalink
fix(kit): fix parallel lazy loading tree nodes (#9939)
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonidSimakov authored Dec 9, 2024
1 parent 52ab367 commit c2a88d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions projects/kit/components/tree/misc/tree.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {inject, Injectable} from '@angular/core';
import {map, startWith, Subject, switchMap, tap} from 'rxjs';
import {map, mergeMap, startWith, Subject, tap} from 'rxjs';

import type {TuiTreeLoader} from './tree.interfaces';
import {TUI_TREE_LOADER, TUI_TREE_LOADING, TUI_TREE_START} from './tree.tokens';
Expand All @@ -13,7 +13,7 @@ export class TuiTreeService<T> {
private readonly load$ = new Subject<T>();

public readonly data$ = this.load$.pipe(
switchMap((item) =>
mergeMap((item) =>
this.loader.loadChildren(item).pipe(
tap((children) => this.map.set(item, children)),
map((children) =>
Expand Down

0 comments on commit c2a88d4

Please sign in to comment.