This factory is used to create the Infinite cache (InfiniteCacheInterface).

The InfiniteCacheInterface is based on IndexedDB to limit the bandwidth usage, and speed up the loading and displaying of data when using a DataSessionInterface.

The sizes of the cache are stored in the LocalStorage of the browser. The former values that were set will be used when creating a new cache / reloading the page.

The connection procedure to IndexedDB is started when the InfiniteCacheInterface is created.

/** 
* Sample to illustrate the use of a cache (InfiniteCacheInterface) in a DataSessionInterface.
*/
import {
InfiniteCacheInterface, InfiniteCacheFactory, DirectorySessionInterface, DataSessionInterfaceSignal, tListenerCallback,
DataSessionInterface,
} from 'generated_files/documentation/appinfiniteapi';

// created previously
let lDirectorySession : DirectorySessionInterface;
// callback called when the DMU is loaded
let onDMULoaded : tListenerCallback;
// the build id to connect to
let lBuildId : string;

// Infinite cache creation
const lCache : InfiniteCacheInterface = InfiniteCacheFactory.CreateInfiniteCache();

// create a data session with a cache
const lDataSession : DataSessionInterface | undefined = lDirectorySession.createDataSession(lBuildId, lCache);
if (lDataSession)
{
// be ready to do something when build is ready (i.e. all init data has been parsed and server is ready)
lDataSession.addEventListener(DataSessionInterfaceSignal.DMULoadingSuccess, onDMULoaded);
// and go !!! => open the data session
lDataSession.openDataSession();
}

Please refer to InfiniteCacheInterface for more information.
Factories

Constructors

Methods

Constructors

Methods