Namespace

forage

forage

-> externally, we are using the same API as localForage, with the exception of the dropInstance interface, which, while still available, has been split out into three distinct calls. Also, are using .then instead of the callback approach, and always catch an error.

Of note are the extensions to the generic interface:

  • mergeItem (with a number of merge strategies available)
  • getKeyValue
  • deleteItemKey
  • hasKey
  • hasKeyValue

Note: Even if undefined is saved, null will be returned by getItem(). This is due to a limitation in localStorage, and for compatibility reasons localForage cannot store the value undefined.

Usage Options:

  1. Exactly the same interface as localForage
  2. With a currying function applied to the result
  3. Modify the value returned (with or without curry)
  4. Define error suppression

View Source curriedForage.esm.js, line 7

Methods

# static config(options)

Parameters:
Name Type Description
options object

View Source curriedForage.esm.js, line 564

# static config(options)

Parameters:
Name Type Description
options object

View Source tauriForage.esm.js, line 564

# static createInstance(name) → {boolean}

This will return the entire object. If you just want to know if it worked, do this:

const driver = !!forage.createInstance({ name: 'Test' })
Parameters:
Name Type Description
name string

View Source curriedForage.esm.js, line 598

boolean

# static createInstance(name) → {boolean}

This will return the entire object. If you just want to know if it worked, do this:

const driver = !!forage.createInstance({ name: 'Test' })
Parameters:
Name Type Description
name string

View Source tauriForage.esm.js, line 598

boolean

# static driver() → {string}

not async, not thenable don't use this. prefer to use config

View Source curriedForage.esm.js, line 572

string

# static driver() → {string}

not async, not thenable don't use this. prefer to use config

View Source tauriForage.esm.js, line 572

string

# static getItem(key, logger, returner, before, store) → {Promise.<(object|string|*)>}

get the object of a specific row if it exists. @

Parameters:
Name Type Description
key string
logger string
returner number
before boolean
store string

View Source curriedForage.esm.js, line 36

Promise.<(object|string|*)>

# static getItem(key, logger, returner, before, store) → {Promise.<(object|string|*)>}

get the object of a specific row if it exists. @

Parameters:
Name Type Description
key string
logger string
returner number
before boolean
store string

View Source tauriForage.esm.js, line 36

Promise.<(object|string|*)>

# static getKeyValue(key, value, curry, logger, returner) → {Promise.<(object|string|*)>}

get the value of a specific key in a row if it exists.

Parameters:
Name Type Description
key string
value string
curry function
logger string
returner number | string

View Source curriedForage.esm.js, line 82

Promise.<(object|string|*)>

# static getKeyValue(key, value, curry, logger, returner) → {Promise.<(object|string|*)>}

get the value of a specific key in a row if it exists.

Parameters:
Name Type Description
key string
value string
curry function
logger string
returner number | string

View Source tauriForage.esm.js, line 82

Promise.<(object|string|*)>

# static mergeItem(key, value, type, restArgs) → {Promise.<(object|string|*)>}

Merging data shouldn't be hard, so that logic is in here. There are so many ways to do it though, that the caller can define merge strategy. This is a "prebuilt" Curry.

See https://ramdajs.com/docs/ for the exact features we are using.

The default is to use the deepWithKey approach.

Parameters:
Name Type Description
key string
value string | object | array
type string
restArgs function | string | number
curry function
logger string
returner number

View Source curriedForage.esm.js, line 215

Promise.<(object|string|*)>

# static mergeItem(key, value, type, restArgs) → {Promise.<(object|string|*)>}

Merging data shouldn't be hard, so that logic is in here. There are so many ways to do it though, that the caller can define merge strategy. This is a "prebuilt" Curry.

See https://ramdajs.com/docs/ for the exact features we are using.

The default is to use the deepWithKey approach.

Parameters:
Name Type Description
key string
value string | object | array
type string
restArgs function | string | number
curry function
logger string
returner number

View Source tauriForage.esm.js, line 215

Promise.<(object|string|*)>

# static setItem(key, value, restArgs) → {Promise.<(object|string|*)>}

set an row if it exists, completely overwrite it if it does not exist.

Parameters:
Name Type Description
key string
value string
restArgs function | string | number
curry function
logger string
returner number

View Source curriedForage.esm.js, line 126

Promise.<(object|string|*)>

# static setItem(restArgs) → {Promise.<string>}

Parameters:
Name Type Description
restArgs function | string | number
index number
curry function
logger string
returner number

View Source curriedForage.esm.js, line 173

Promise.<string>

# static setItem(key, value, restArgs) → {Promise.<(object|string|*)>}

set an row if it exists, completely overwrite it if it does not exist.

Parameters:
Name Type Description
key string
value string
restArgs function | string | number
curry function
logger string
returner number

View Source tauriForage.esm.js, line 126

Promise.<(object|string|*)>

# static setItem(restArgs) → {Promise.<string>}

Parameters:
Name Type Description
restArgs function | string | number
index number
curry function
logger string
returner number

View Source tauriForage.esm.js, line 173

Promise.<string>

forage

-> externally, we are using the same API as localForage, with the exception of the dropInstance interface, which, while still available, has been split out into three distinct calls. Also, are using .then instead of the callback approach, and always catch an error.

Of note are the extensions to the generic interface:

  • mergeItem (with a number of merge strategies available)
  • getKeyValue
  • deleteItemKey
  • hasKey
  • hasKeyValue

Note: Even if undefined is saved, null will be returned by getItem(). This is due to a limitation in localStorage, and for compatibility reasons localForage cannot store the value undefined.

Usage Options:

  1. Exactly the same interface as localForage
  2. With a currying function applied to the result
  3. Modify the value returned (with or without curry)
  4. Define error suppression

View Source tauriForage.esm.js, line 7

Methods

# static config(options)

Parameters:
Name Type Description
options object

View Source curriedForage.esm.js, line 564

# static config(options)

Parameters:
Name Type Description
options object

View Source tauriForage.esm.js, line 564

# static createInstance(name) → {boolean}

This will return the entire object. If you just want to know if it worked, do this:

const driver = !!forage.createInstance({ name: 'Test' })
Parameters:
Name Type Description
name string

View Source curriedForage.esm.js, line 598

boolean

# static createInstance(name) → {boolean}

This will return the entire object. If you just want to know if it worked, do this:

const driver = !!forage.createInstance({ name: 'Test' })
Parameters:
Name Type Description
name string

View Source tauriForage.esm.js, line 598

boolean

# static driver() → {string}

not async, not thenable don't use this. prefer to use config

View Source curriedForage.esm.js, line 572

string

# static driver() → {string}

not async, not thenable don't use this. prefer to use config

View Source tauriForage.esm.js, line 572

string

# static getItem(key, logger, returner, before, store) → {Promise.<(object|string|*)>}

get the object of a specific row if it exists. @

Parameters:
Name Type Description
key string
logger string
returner number
before boolean
store string

View Source curriedForage.esm.js, line 36

Promise.<(object|string|*)>

# static getItem(key, logger, returner, before, store) → {Promise.<(object|string|*)>}

get the object of a specific row if it exists. @

Parameters:
Name Type Description
key string
logger string
returner number
before boolean
store string

View Source tauriForage.esm.js, line 36

Promise.<(object|string|*)>

# static getKeyValue(key, value, curry, logger, returner) → {Promise.<(object|string|*)>}

get the value of a specific key in a row if it exists.

Parameters:
Name Type Description
key string
value string
curry function
logger string
returner number | string

View Source curriedForage.esm.js, line 82

Promise.<(object|string|*)>

# static getKeyValue(key, value, curry, logger, returner) → {Promise.<(object|string|*)>}

get the value of a specific key in a row if it exists.

Parameters:
Name Type Description
key string
value string
curry function
logger string
returner number | string

View Source tauriForage.esm.js, line 82

Promise.<(object|string|*)>

# static mergeItem(key, value, type, restArgs) → {Promise.<(object|string|*)>}

Merging data shouldn't be hard, so that logic is in here. There are so many ways to do it though, that the caller can define merge strategy. This is a "prebuilt" Curry.

See https://ramdajs.com/docs/ for the exact features we are using.

The default is to use the deepWithKey approach.

Parameters:
Name Type Description
key string
value string | object | array
type string
restArgs function | string | number
curry function
logger string
returner number

View Source curriedForage.esm.js, line 215

Promise.<(object|string|*)>

# static mergeItem(key, value, type, restArgs) → {Promise.<(object|string|*)>}

Merging data shouldn't be hard, so that logic is in here. There are so many ways to do it though, that the caller can define merge strategy. This is a "prebuilt" Curry.

See https://ramdajs.com/docs/ for the exact features we are using.

The default is to use the deepWithKey approach.

Parameters:
Name Type Description
key string
value string | object | array
type string
restArgs function | string | number
curry function
logger string
returner number

View Source tauriForage.esm.js, line 215

Promise.<(object|string|*)>

# static setItem(key, value, restArgs) → {Promise.<(object|string|*)>}

set an row if it exists, completely overwrite it if it does not exist.

Parameters:
Name Type Description
key string
value string
restArgs function | string | number
curry function
logger string
returner number

View Source curriedForage.esm.js, line 126

Promise.<(object|string|*)>

# static setItem(restArgs) → {Promise.<string>}

Parameters:
Name Type Description
restArgs function | string | number
index number
curry function
logger string
returner number

View Source curriedForage.esm.js, line 173

Promise.<string>

# static setItem(key, value, restArgs) → {Promise.<(object|string|*)>}

set an row if it exists, completely overwrite it if it does not exist.

Parameters:
Name Type Description
key string
value string
restArgs function | string | number
curry function
logger string
returner number

View Source tauriForage.esm.js, line 126

Promise.<(object|string|*)>

# static setItem(restArgs) → {Promise.<string>}

Parameters:
Name Type Description
restArgs function | string | number
index number
curry function
logger string
returner number

View Source tauriForage.esm.js, line 173

Promise.<string>