Developers

Loader

Overview

This component displays a loading image while the SDK is waiting for results after a search has been done. This loading image is removed after the results are retrieved.

This component must be linked with a search Store, since it listens to its events to check if the SDK has a search in process.

Usage

This is how you create this component:

sdk.component('loader', target: HTMLElement|String);

Tracking

This component does not track any event.

Example using results component Store through method linkTo

<div id="results"></div>
<div id="loader"></div>

<script>
  var results = sdk.component('results', '#results');
  var loader = sdk.component('loader', '#loader');
  results.linkTo(loader);
</script>

In this example, the loader component listens to the Store events of the results component.