Published
Edited
Dec 7, 2020
Importers
Insert cell
md`# cross-storage`
Insert cell
CrossStorageClient = require('cross-storage@1.0.0/dist/client.js')
Insert cell
crossStorageListen = async function*(crossStorage, key) {
await crossStorage.onConnect()

let oldData;
while (true) {
const newData = await crossStorage.get(key);
if (newData !== oldData) {
oldData = newData;
yield newData;
}
await sleep(200);
}
}
Insert cell
function sleep(duration) {
return new Promise(resolve => setTimeout(resolve, duration));
}
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