Published
Edited
May 19, 2020
1 fork
1 star
Insert cell
Insert cell
qrstore
Insert cell
Insert cell
Insert cell
Insert cell
viewof qrstore = {
const value = ["initial"],
img = DOM.element("img"),
notify = async () => (
img.dispatchEvent(new CustomEvent('input')),
qrcode.toDataURL(JSON.stringify(value)).then(u => (img.src = u))
),
append = message => (value.push(message), notify()),
empty = () => (value.splice(0, value.length), notify());

notify();
return Object.assign(img, { append, empty, value });
}
Insert cell
qrcode = require("https://bundle.run/qrcode@1.4.1")
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