Constructor

createAdapter(options)

Creates adapter that provides access to storage given adapter uses.

Name of the method used depends on how you will import given adapter. Let's stick to createAdapter.

Arguments

  1. options (object) Each adapter has one, required property: namespace.
    Namespace is usually a string with some restrictions as to what characters can be used. Each adapter can have different rules. Every adapter holds information what characters can be used and what happens when validation fails.

    Any other properties depend only on used adapter. Various adapters can have different, required properties that need to be passed.

Throws

Depends on type of adapter used. See the list of available adapters.

Returns

(Adapter instance): An object that holds methods that provide access to storage given adapter uses.

Example

import createAdapter from 'any-stash-it-compatible-adapter'; // e.g. stash-it-adapter-memory

results matching ""

    No results matching ""