0.2.7 • Published 5 years ago

rxidb v0.2.7

Weekly downloads
5
License
Apache-2.0
Repository
github
Last release
5 years ago

RxIDB

This repo is "work in progress", so be aware of.

  import { openDB } from 'rxidb';

  // Open DB, provide name and db version
  openDB('MyDB', 1, [

    // For each Store you can describe upgrade
    // process as [dbVersion, upgradeInstaller]
    new Map([
      [1, (dbUpgrade) => {
        dbUpgrade
          .create('Store 1', { autoIncrement: true })
          .fill([ ENTRY_1, ENTRY_2 ])
      }],
      [4, (dbUpgrade) => {
        // If you return an Observable, db waits
        // util it emits any value
        return of(SomePromise);
      }]
    ])
  ]).subscribe((rxIDB) => {
    let store = rxIDB.get('Store1');

    // Get value by key
    store.get('key').subscribe();

    // Open transaction for selected store
    store.tx('readwrite').subscribe();

    // Original IDBTransaction accessible with:
    rxIDB.transaction(...);
  });
0.2.7

5 years ago

0.2.6

6 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago