gongo-client
v2.8.2
Published
DX focused in-browser database with offline and realtime
Downloads
56
Maintainers
Readme
gongo-client
WIP: DX focused in-browser database with offline and realtime.
Copyright (c) 2020 by Gadi Cohen. Released under the 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