Class IndexedDb

This class contains methods for accessing the window.indexedDb. See theIndexedDb for the one and only one instance of this class

Source : file core/uiLib/IndexedDb.js at line 32

Constructor

new IndexedDb ( )

Constructor

Source : file core/uiLib/IndexedDb.js at line 139

Public methods

closeDb ( UUID )

Remove the data in the indexedDb and close it

Source : file core/uiLib/IndexedDb.js at line 183

Parameters

Name Type Description
UUID String

An UUID used to identify the data in the indexedDb

getOpenPromise ( )

Open the indexedDb

Source : file core/uiLib/IndexedDb.js at line 148

Returns

A Promise that fullfil when the indexedDb is opened or reject when a problem occurs
Type : Promise

getReadPromise ( UUID )

Read data in the indexedDb.

Source : file core/uiLib/IndexedDb.js at line 159

Parameters

Name Type Description
UUID String

An UUID used to identify the data in the indexedDb

Returns

A promise that fullfil when the data are read or reject when a problem occurs The success handler receive the data as parameter
Type : Promise

getWritePromise ( UUID, data )

Write data in the indexedDb.

Source : file core/uiLib/IndexedDb.js at line 171

Parameters

Name Type Description
UUID String

An UUID used to identify the data in the indexedDb

data String

The data to put in the indexedDb

Returns

A promise that fullfil when the data are written or reject when a problem occurs
Type : Promise

Private properties

#data : String

A temp variable used to store the data to write in the indexedDb

Source : file core/uiLib/IndexedDb.js at line 53

#indexedDb : IDBFactory

A reference to the opened indexedDB

Source : file core/uiLib/IndexedDb.js at line 39

#UUID : String

The UUID of the current travel

Source : file core/uiLib/IndexedDb.js at line 46

Private getters and setters

readonly static get #DB_VERSION : Number

The version of the db to use

Source : file core/uiLib/IndexedDb.js at line 61

Private methods

#close ( )

Perform the close operations

Source : file core/uiLib/IndexedDb.js at line 130

#open ( onOk, onError )

Perform the open operations

Source : file core/uiLib/IndexedDb.js at line 69

Parameters

Name Type Description
onOk Function

The Ok handler for the Promise

onError Function

The error handler for the Promise

#read ( onOk, onError )

Perform the read operations

Source : file core/uiLib/IndexedDb.js at line 95

Parameters

Name Type Description
onOk Function

The Ok handler for the Promise

onError Function

The error handler for the Promise

#write ( onOk, onError )

Perform the write operations

Source : file core/uiLib/IndexedDb.js at line 114

Parameters

Name Type Description
onOk Function

The Ok handler for the Promise

onError Function

The error handler for the Promise