Trigger Service With A Delay

Discussão em 'Angular' iniciado por user8512043, Novembro 9, 2024.

  1. user8512043

    user8512043 Guest

    Currently I am using Lodash decorator to delay a service call on drop down value change. In the select tag, I did something as follows:

    (onSelectionChange)="logUserSearchData()"


    In the TypeScript file, I've the following:

    logUserSearchData() {
    logService();
    }

    @Debounce(10000)
    logService() {
    this.logService().subscribe();
    }


    In the above code snippet, the logService() is triggered after 10s whenever there's a change in drop down or value change. Is there a way in RxJS to do the same without using the Lodash decorator?

    Continue reading...

Compartilhe esta Página