Skip to content

Commit

Permalink
fix(addon-doc): DocDemo remove timer and tuiZonefreeScheduler
Browse files Browse the repository at this point in the history
  • Loading branch information
mdlufy committed Oct 10, 2024
1 parent 2756608 commit 170ec4b
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions projects/addon-doc/components/demo/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@ import {JsonPipe, Location, NgIf, NgTemplateOutlet} from '@angular/common';
import type {AfterViewInit, ElementRef} from '@angular/core';
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
computed,
ContentChild,
DestroyRef,
inject,
Input,
NgZone,
signal,
TemplateRef,
ViewChild,
Expand All @@ -23,7 +20,6 @@ import {TUI_DOC_DEMO_TEXTS, TUI_DOC_URL_STATE_HANDLER} from '@taiga-ui/addon-doc
import type {TuiDemoParams} from '@taiga-ui/addon-doc/types';
import {tuiCleanObject, tuiCoerceValueIsTrue} from '@taiga-ui/addon-doc/utils';
import {TuiResizable, TuiResizer} from '@taiga-ui/cdk/directives/resizer';
import {tuiZonefreeScheduler} from '@taiga-ui/cdk/observables';
import {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';
import {tuiClamp, tuiToInteger} from '@taiga-ui/cdk/utils/math';
import {tuiPure, tuiPx} from '@taiga-ui/cdk/utils/miscellaneous';
Expand All @@ -36,7 +32,7 @@ import {TuiSwitch} from '@taiga-ui/kit/components/switch';
import {TuiChevron} from '@taiga-ui/kit/directives/chevron';
import {TuiSelectModule} from '@taiga-ui/legacy/components/select';
import {TuiTextfieldControllerModule} from '@taiga-ui/legacy/directives/textfield-controller';
import {skip, timer} from 'rxjs';
import {skip} from 'rxjs';

const MIN_WIDTH = 160;

Expand Down Expand Up @@ -80,9 +76,6 @@ export class TuiDocDemo implements AfterViewInit {
private readonly resizer?: ElementRef<HTMLElement>;

private readonly el = tuiInjectElement();
private readonly destroyRef = inject(DestroyRef);
private readonly cdr = inject(ChangeDetectorRef);
private readonly ngZone = inject(NgZone);
private readonly locationRef = inject(Location);
private readonly urlSerializer = inject(UrlSerializer);
private readonly urlStateHandler = inject(TUI_DOC_URL_STATE_HANDLER);
Expand Down Expand Up @@ -122,15 +115,9 @@ export class TuiDocDemo implements AfterViewInit {
public sticky = true;

public ngAfterViewInit(): void {
timer(0, tuiZonefreeScheduler(this.ngZone))
.pipe(takeUntilDestroyed(this.destroyRef))
.subscribe(() => {
this.createForm();
this.updateWidth(this.sandboxWidth + this.delta);
this.rendered.set(true);

this.cdr.detectChanges();
});
this.createForm();
this.updateWidth(this.sandboxWidth + this.delta);
this.rendered.set(true);
}

protected onResize(): void {
Expand Down

0 comments on commit 170ec4b

Please sign in to comment.