1.1.0 • Published 5 years ago

mqtt-localforage-store v1.1.0

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

MQTT.js localForage Store for the browser

Build Status

Installation

NPM

yarn add mqtt-localforage-store localforage
# or
npm install --save mqtt-localforage-store

Compile yourself

git clone git@github.com:viniciusbo/mqtt-localforage-store.git && cd mqtt-localforage-store
yarn # or npm install
npm run build
cd /dist

Distribution bundles are located in /dist folder. The build exposes the MQTTLocalForageStore globally.

Usage

import localForage from 'localforage';
import Store as MQTTLocalForageStore from 'mqtt-localforage-store';

// Make your own localForage instances
const incomingDb = localForage.createInstance({ name: 'incomingPackets' });
const outgoingDb = localForage.createInstance({ name: 'outgoingPackets' });

const incomingStore = MQTTLocalForageStore(incomingDb);
const outgoingStore = MQTTLocalForageStore(outgoingDb);

mqtt.connect({
  // ...
  incomingStore,
  outgoingStore,
});

Test

yarn # or npm install
npm run test
1.1.0

5 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago