Service Provider

Use the IndexedDB connector service provider to use IndexedDB as a data source.

Provider Key

Use the indexed-db provider key to use the service provider for this data connector with a data source.

const service = new wire.data.DataSource("indexed-db", {
    ...    
});

Configuration

Stores

The following example creates a new data source using the IndexedDB Connector. When initialized, the service provider will create new a store called My Store in IndexedDB if it does not already exist adding an array of fruits data.

const fruits = [
    { name: "grapes", color: "green"},
    { name: "bananas", color: "yellow"},
    { name: "apples", color: "red"},
];
const source = new wire.data.DataSource("indexed-db", {
  Provider: {
     stores: [
          { name: "My Store", data: fruits }
      ]}
});

Allow

Service providers are able to tell consumers about the functionality they support through an allow property. Below is a list of the functionality that the service provider supports.

Last updated