Options
All
  • Public
  • Public/Protected
  • All
Menu

Serves as an abstraction over a number of different client - side storage technologies.

Hierarchy

  • Store

Index

Constructors

constructor

  • Initializes a new instance of an {@link geocortex.framework.storage.Store} object.

    Parameters

    • app: Application

      The {@link application.Application} that this module belongs to.

    • Optional keyNamespace: string

    Returns Store

Methods

clear

  • clear(successCallback?: function, errorCallback?: function): void
  • Clears all local data for the current application.

    Parameters

    • Optional successCallback: function

      The callback to fire after the data has been successfully cleared.

        • (): void
        • Returns void

    • Optional errorCallback: function

      The callback to fire if an error occurs.

        • (error: Error): void
        • Parameters

          • error: Error

          Returns void

    Returns void

clearAllData

  • clearAllData(successCallback?: function, errorCallback?: function): void
  • Clears all local data for this domain.

    Parameters

    • Optional successCallback: function

      The callback to fire after the data has been successfully cleared.

        • (): void
        • Returns void

    • Optional errorCallback: function

      The callback to fire if an error occurs.

        • (error: Error): void
        • Parameters

          • error: Error

          Returns void

    Returns void

get

  • get(key: string, successCallback?: function, errorCallback?: function, shared?: boolean): Deferred
  • Gets the value for the given key, firing a success callback with the value (or null if it wasn't found).

    Parameters

    • key: string

      The key for which value to fetch.

    • Optional successCallback: function

      (value, key) The callback to invoke upon successfully reading from the underlying storage mechanism.

        • (value: any, key: string): void
        • Parameters

          • value: any
          • key: string

          Returns void

    • Optional errorCallback: function

      (error, key) The callback to invoke if an error occurs trying to read from the underlying storage mechanism.

        • (error: Error, key: string): void
        • Parameters

          • error: Error
          • key: string

          Returns void

    • Optional shared: boolean

      An optional flag that when set to true causes the storage mechanism to fetch the resource as a resource that is common to all applications on the same domain. Default is false.

    Returns Deferred

hasProvider

  • hasProvider(): boolean
  • Returns boolean

initialize

  • Initializes the store. During initialization, the most appropriate storage technology for the current user agent will be chosen.

    Parameters

    • Optional provider: StorageProviderBase

      If passed, this provider will be used instead of the Store attempting to detect the most suitable choice.

    Returns void

remove

  • remove(key: string, successCallback: function, errorCallback: function, shared?: boolean): any
  • Removes a key and associated value from the store.

    Parameters

    • key: string

      The key for which key/value pair to remove.

    • successCallback: function

      (key) The callback to invoke upon successfully removing from the underlying storage mechanism.

        • (key: string): void
        • Parameters

          • key: string

          Returns void

    • errorCallback: function

      (error, key) The callback to invoke if an error occurs trying to remove from the underlying storage mechanism.

        • (error: Error, key: string): void
        • Parameters

          • error: Error
          • key: string

          Returns void

    • Optional shared: boolean

      An optional flag that when set to true removes a resource previously saved as a shared resource. Default is false.

    Returns any

set

  • set(key: string, value: any, successCallback: function, errorCallback: function, shared?: boolean): any
  • Sets the value for the given key, creating the key if it does not exist, and overwriting the current value if it does.

    Parameters

    • key: string

      The key to set the value of.

    • value: any

      The string value to set.

    • successCallback: function

      (key, value) The callback to invoke upon successfully writing to the underlying storage mechanism.

        • (key: string, value: any): void
        • Parameters

          • key: string
          • value: any

          Returns void

    • errorCallback: function

      (error, key, value) The callback to invoke if an error occurs trying to write to the underlying storage mechanism. Passed a key, and the error that occurred.

        • (error: Error, key: string, value: any): void
        • Parameters

          • error: Error
          • key: string
          • value: any

          Returns void

    • Optional shared: boolean

      An optional flag that when set to true causes the storage mechanism to save the resource in a way that is common to all applications on the same domain. Default is false.

    Returns any