Options
All
  • Public
  • Public/Protected
  • All
Menu

A basic store.

Hierarchy

Implements

Index

Constructors

Methods

Constructors

constructor

Methods

get

  • get<TValue, TDefault>(key: any, defaultValue?: TDefault): TValue | TDefault
  • Tries to return a value from the store.

    Type parameters

    • TValue = any

    • TDefault = TValue

    Parameters

    • key: any

      The key.

    • Optional defaultValue: TDefault

    Returns TValue | TDefault

    The read value or the default value.

Protected Abstract getValue

  • getValue(key: string, valueToReturn: BoxedValue<any>): void
  • The logic for the 'get()' method.

    Parameters

    • key: string

      The key.

    • valueToReturn: BoxedValue<any>

      Stores the value to return.

    Returns void

set

  • set(key: any, value: any): Promise<boolean>
  • Tries set a value in the store.

    Parameters

    • key: any

      The key.

    • value: any

      The value to set.

    Returns Promise<boolean>

    The promise with the value that indicates if operation was successfull or not.

Protected Abstract setValue

  • setValue(key: string, value: any, succeeded: BoxedValue<boolean>): Promise<void>
  • The logic for the 'set()' method.

    Parameters

    • key: string

      The key.

    • value: any

      The value to set.

    • succeeded: BoxedValue<boolean>

      Indicates if operation was successful or not.

    Returns Promise<void>

Generated using TypeDoc