How to use the @ngneat/transloco.isFunction function in @ngneat/transloco

To help you get started, we’ve selected a few @ngneat/transloco 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 ngneat / transloco / projects / ngneat / transloco-persist-lang / src / lib / persist-lang.service.ts View on Github external
private setActiveLang() {
    const cachedLang =;
    const browserLang = getBrowserLang();
    const cultureLang = getBrowserCultureLang();
    const defaultLang = this.service.config.defaultLang;
    const activeLang = isFunction(this.config.getLangFn)
      ? this.config.getLangFn({
      : cachedLang || defaultLang;

    activeLang && this.service.setActiveLang(activeLang);