How to use the @spartacus/core.DeferLoadingStrategy.INSTANT function in @spartacus/core

To help you get started, we’ve selected a few @spartacus/core 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 SAP / cloud-commerce-spartacus-storefront / projects / storefrontlib / src / layout / loading / defer-loader.service.ts View on Github external
private shouldLoadInstantly(
    elementLoadingStrategy: DeferLoadingStrategy
  ): boolean {
    return (
      isPlatformServer(this.platformId) ||
      elementLoadingStrategy === DeferLoadingStrategy.INSTANT ||
      (elementLoadingStrategy !== DeferLoadingStrategy.DEFER &&
        this.globalLoadStrategy === DeferLoadingStrategy.INSTANT)
    );
  }
}
github SAP / cloud-commerce-spartacus-storefront / projects / storefrontlib / src / layout / intersection / intersection.service.ts View on Github external
private useInstantLoading(): boolean {
    return (
      this.config.deferredLoading &&
      this.config.deferredLoading.strategy === DeferLoadingStrategy.INSTANT
    );
  }
github SAP / cloud-commerce-spartacus-storefront / projects / storefrontlib / src / layout / loading / defer-loader.service.ts View on Github external
constructor(
    @Inject(PLATFORM_ID) private platformId: Object,
    protected config: LayoutConfig,
    protected intersectionService: IntersectionService
  ) {
    this.globalLoadStrategy = config.deferredLoading
      ? config.deferredLoading.strategy
      : DeferLoadingStrategy.INSTANT;
  }
github SAP / cloud-commerce-spartacus-storefront / projects / storefrontlib / src / layout / loading / defer-loader.service.ts View on Github external
private shouldLoadInstantly(
    elementLoadingStrategy: DeferLoadingStrategy
  ): boolean {
    return (
      isPlatformServer(this.platformId) ||
      elementLoadingStrategy === DeferLoadingStrategy.INSTANT ||
      (elementLoadingStrategy !== DeferLoadingStrategy.DEFER &&
        this.globalLoadStrategy === DeferLoadingStrategy.INSTANT)
    );
  }
}