Set of methods to operate eitri-app data storage

Notes:

Storage data is not shared between different eitri-apps. Data is transmitted as a string and handled with JSON encoding/decoding. Pay attention to the size of the data to avoid affecting the experience.

Hierarchy

  • Storage

Methods

  • Clears all data created by the respective eitri-app from storage

    Note:

    This method does not clear other data saved by other eitri-apps

    Example:

    await Eitri.storage.clear()
    

    Compatibility Control

    • API LEVEL 1 - Functionality added

    Returns Promise<any>

  • Gets a piece of data from eitri-app storage

    Example:

    const storedValue = await Eitri.storage.getItem('myData')
    const myValue = JSON.parse(storedValue)

    Compatibility Control

    • API LEVEL 1 - Functionality added

    Parameters

    • key: string

      Registration key

    Returns Promise<any>

  • Retrieves all registration keys stored by the respective eitri-app from storage

    Example:

    const myKeys = await Eitri.storage.keys()
    

    Compatibility Control

    • API LEVEL 1 - Functionality added

    Returns Promise<any>

  • Deletes a piece of data from eitri-app storage

    Example:

    await Eitri.storage.removeItem('myData')
    

    Compatibility Control

    • API LEVEL 1 - Functionality added

    Parameters

    • key: string

      Registration key

    Returns Promise<any>

  • Saves a piece of data to eitri-app storage

    Example:

    await Eitri.storage.setItem('myData', JSON.stringify({myData: 'valueOfMyData'}))
    

    Parameters

    • key: string

      Key for registration

    • value: string

      Value to be saved

      Compatibility Control

      • API LEVEL 1 - Functionality added

    Returns Promise<any>

Generated using TypeDoc