Skip to content

Instantly share code, notes, and snippets.

@fouad
Forked from crcn/chatroom.js
Last active August 29, 2015 14:17
Show Gist options
  • Save fouad/ae3e2c9ba8cf4d123bf3 to your computer and use it in GitHub Desktop.
Save fouad/ae3e2c9ba8cf4d123bf3 to your computer and use it in GitHub Desktop.
var crudlet = require("crudlet");
var localstore = require("crudlet-local-storage");
var pubnub = require("crudlet-pubnub");
var http = require("crudlet-http");
var localdb = localstore();
var httpdb = http()
var pubdb = pubnub();
var allDbs = crudlet.parallel(httpdb, pubdb);
crudlet.run(pubdb, "tail").pipe(crudlet.stream(localdb));
crudlet.run(allDbs, "insert", { data: { message: "hello world" }});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment