How to use the @deckdeckgo/utils.debounce function in @deckdeckgo/utils

To help you get started, we’ve selected a few @deckdeckgo/utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github deckgo / deckdeckgo / studio / src / app / handlers / editor / events / remote / remote-events.handler.tsx View on Github external
return new Promise(async (resolve) => {
            const deckgoRemoteElement = this.el.querySelector('deckgo-remote');

            if (!deckgoRemoteElement || !window) {
                resolve();
                return;
            }

            const config: EnvironmentDeckDeckGoConfig = EnvironmentConfigService.getInstance().get('deckdeckgo');
            deckgoRemoteElement.socketUrl = config.socketUrl;

            deckgoRemoteElement.addEventListener('event', async ($event) => {
                await this.remoteEvent($event)
            });

            window.addEventListener('resize', debounce(async () => {
                await this.initRemoteSize();
            }, 300));

            await this.initSlidesDidLoadListener();

            await this.initDeckMove();

            await this.remoteService.init();

            this.el.addEventListener('slideDelete', this.onSlideDelete, false);
            this.el.addEventListener('slideDidUpdate', this.slideDidUpdate, false);
            this.el.addEventListener('pollUpdated', this.pollUpdated, false);
            this.el.addEventListener('deckDidChange', this.deckDidChange, false);

            resolve();
        });
github deckgo / deckdeckgo / webcomponents / slides / youtube / src / components / slide / deckdeckgo-slide-youtube.tsx View on Github external
private initWindowResize() {
    if (window) {
      window.addEventListener('resize', debounce(this.onResizeContent));
    }
  }
github deckgo / deckdeckgo / webcomponents / inline-editor / src / components / inline-editor / deckdeckgo-inline-editor.tsx View on Github external
private resetDisplayToolsActivated() {
    this.debounceDisplayToolsActivated = debounce(() => {
      this.displayToolsActivated = true;
    });
  }
github deckgo / deckdeckgo / remote / src / app / components / app-bottom-sheet / app-bottom-sheet.tsx View on Github external
private removeWindowResize() {
        if (window) {
            window.removeEventListener('resize', debounce(this.onWindowResize));
        }
    }
github deckgo / deckdeckgo / remote / src / app / components / app-bottom-sheet / app-bottom-sheet.tsx View on Github external
private initWindowResize() {
        if (window) {
            window.addEventListener('resize', debounce(this.onWindowResize));
        }
    }
github deckgo / deckdeckgo / webcomponents / slides / poll / src / components / slide / deckdeckgo-slide-poll.tsx View on Github external
private initWindowResize() {
    if (window) {
      window.addEventListener('resize', debounce(this.onResizeContent));
    }
  }
github deckgo / deckdeckgo / webcomponents / slides / chart / src / components / slide / deckdeckgo-slide-chart.tsx View on Github external
private initWindowResize() {
    if (window) {
      window.addEventListener('resize', debounce(this.onResizeContent, 500));
    }
  }
github deckgo / deckdeckgo / webcomponents / core / src / components / deck / deckdeckgo-deck / deckdeckgo-deck.tsx View on Github external
private initWindowResize() {
    if (window) {
      window.addEventListener('resize', debounce(async () => {
        await this.initSlideSize();
        await this.slideTo(this.activeIndex);

        const toggleFullscreen: boolean = isFullscreen();
        await this.hideOrClearMouseCursorTimer(toggleFullscreen);
        await this.showHideActionsSlot(toggleFullscreen);
      }, 100));
    }
  }