Skip to main content

IDatabaseOptions <T>

Configuration for the database.

@field

env - Override environment detection as ‘NODEJS’, ‘BROWSER’, ‘CORDOVA’

@field

verbose - Enable console output

@field

autosave - Enables autosave

@field

autosaveInterval - Time interval (in milliseconds) between saves (if dirty)

@field

autoLoad - Enables auto load on database instantiation

@field

autoLoadCallback - User callback called after database load

@field

autosaveCallback - User callback called after database saved

@field

adapter - An instance of a database persistence adapter

@field

serializationMethod - How to serialize the data

@field

destructureDelimiter - String delimiter used for destructured serialization

@field

throttledSaves - debounces multiple calls to to saveDatabase reducing number of disk I/O operations and guaranteeing proper serialization of the calls.

Index

Properties

adapter

adapter: PersistenceAdapter<T>

autoLoad

autoLoad: boolean

optionalautoLoadCallback

autoLoadCallback?: () => void

Type declaration

    • (): void
    • Returns void

autosave

autosave: boolean

optionalautosaveCallback

autosaveCallback?: () => void

Type declaration

    • (): void
    • Returns void

autosaveInterval

autosaveInterval: number

destructureDelimiter

destructureDelimiter: string

env

env: Environment

serializationMethod

serializationMethod: SerializationMethod

throttledSaves

throttledSaves: boolean

verbose

verbose: boolean