gongo-client
TypeScript icon, indicating that this package has built-in type declarations

2.8.2 • Public • Published

gongo-client

WIP: DX focused in-browser database with offline and realtime.

Copyright (c) 2020 by Gadi Cohen. Released under the MIT License.

npm CircleCI coverage MIT License

Project

Main project page https://github.com/gongojs/project

Features

  • Client-side database. Offline first.
  • Subscribes to datasets, realtime support.
  • Optimistic updates for free.

QuickStart

import db from "gongo-client";
import HTTPTransport from "gongo-client/lib/transports/http";

// Should match your gongo-server setup; this is the serverless poll transport.
new HTTPTransport(db, "http://localhost:3001/api/gongoPoll");

const test = db.collection("test");
db.subscribe("test"); // subscribe to "test" publication (see gongo-server)
test.persist(); // persist this collection through browser restart

window.db = db; // so you can play in the browser console
window.test = test; // ditto

TODO

[ ] idb must store JSON compliant data (e.g. no Dates) [X] pending stuff shuold be stored in idb too [X] persist should be subscription-level and not collection-level [ ] webWorker implementation, with same API on main thread [ ] serviceWorker implementation with notifications

Package Sidebar

Install

npm i gongo-client

Weekly Downloads

3

Version

2.8.2

License

MIT

Unpacked Size

372 kB

Total Files

136

Last publish

Collaborators

  • gadicc