Public
Edited
May 28, 2024
1 fork
18 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
tweet("1506214338503364613")
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
referenceApp = (initializeGate,
rtdb,
app.initializeApp(
{
/* apiKey & authDomain required for authentication, but you can talk to an RTDB unathenticated without these */
apiKey: "AIzaSyBN4bxw6d0cM0CGPNzRrkRlBqwFQnPLdN4",
authDomain: "larkworthy-dfb11.firebaseapp.com",
databaseURL:
"https://larkworthy-dfb11-default-rtdb.europe-west1.firebasedatabase.app"
// "https://s-euw1b-nss-205.europe-west1.firebasedatabase.app?ns=larkworthy-dfb11-default-rtdb"
},
"reference"
))
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
viewof refSetSuccess = buttonGate("ref.set('/...') success")
Insert cell
(refSetSuccess,
rtdb.set(rtdb.child(refRoot, "@tomlarkworthy/rtdb-protocol-explorer/rw"), "hi"))
Insert cell
Insert cell
Insert cell
viewof refPatchSuccess = buttonGate("ref.update('/...') success")
Insert cell
(refPatchSuccess,
rtdb.update(rtdb.child(refRoot, "@tomlarkworthy/rtdb-protocol-explorer"), {
rw: "hi"
}))
Insert cell
Insert cell
viewof refOnValueSuccess = buttonGate("ref.onValue('...')")
Insert cell
Generators.observe((notify) => {
refOnValueSuccess,
rtdb.onValue(
rtdb.child(refRoot, "@tomlarkworthy/rtdb-protocol-explorer/rw"),
(snap) => {
notify(snap.val());
}
);
})
Insert cell
Insert cell
Insert cell
viewof refOff = buttonGate("ref.off('...')")
Insert cell
(refOff,
rtdb.off(rtdb.child(refRoot, "@tomlarkworthy/rtdb-protocol-explorer/rw")))
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
(refSignIn, auth.signInAnonymously(await auth.getAuth(referenceApp)))
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
(refSignOut, auth.signOut(await auth.getAuth(referenceApp)))
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
fakeApp = (initializeFakeGate,
console.log("initialize fake app"),
app.initializeApp(
{
databaseURL: FAKE_SERVER_URL
},
Math.random().toString(16) // We randomize the name so we can rerun initialization
))
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Generators.observe((notify) => {
fakeOnValueSuccess,
rtdb.onValue(
rtdb.child(fakeRoot, "@tomlarkworthy/rtdb-protocol-explorer/rw"),
(snap) => {
notify(snap.val());
}
);
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more