Skip to content

Commit

Permalink
refactor: add tuiZonefreeScheduler to TUI_DOC_PAGE_LOADED
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode committed Sep 8, 2024
1 parent 99733f9 commit 5c3abad
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion projects/addon-doc/tokens/page-loaded.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import {tuiZonefreeScheduler} from '@taiga-ui/cdk/observables';
import {tuiCreateToken} from '@taiga-ui/cdk/utils/miscellaneous';
import {defer, of, switchMap, timer} from 'rxjs';
/**
* Stream that emits if loading of page is over (for example, to begin scrollIntoView)
*/
export const TUI_DOC_PAGE_LOADED = tuiCreateToken(
defer(() => timer(200).pipe(switchMap(() => of(true)))),
defer(() => timer(200, tuiZonefreeScheduler()).pipe(switchMap(() => of(true)))),
);

0 comments on commit 5c3abad

Please sign in to comment.