Hierarchy

  • IStorage

Methods

getItem

  • getItem(key: string): Promise<string | null>
  • Get data from the server using a key.

    Parameters

    • key: string

    Returns Promise<string | null>

setItem

  • setItem(key: string, value: string): Promise<void>
  • Save data to the server using a key.

    The size of the value is limited: it must not exceed 16 megabytes.

    await Application.storage.setItem('key', JSON.stringify({ 'some_key' :  'some_data', 'arr' : [ 1, 2, 3 ] }));
    // Further in the code, when data is  requested 
    let value = JSON.parse(await Application.storage.getItem('key'));  
    

    Parameters

    • key: string

      Value key.

    • value: string

      Data to be saved.

    Returns Promise<void>