Published unlisted
Edited
Sep 6, 2022
Importers
2 stars
Insert cell
Insert cell
/*
function setupStorage(options = {}) {
const {
name = getNamespace(),
backend = null,
serializer: getSerializer = 'string',
interface: getInterface = 'storage',
} = options;
const serializer = keyOrCallback(serializers, getSerializer)();
function keyOrCallback(obj, value) {
return typeof value === 'function' ? value : obj[value];
}
}*/
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
// Todo: todo
class LocalStorageBackend {
export() {
}
import() {
}
}
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
compat = {
const queue = [];
// EventTarget() constructor
try {
(new EventTarget).constructor;
}
catch(e) {
queue.push(require('@ungap/event-target').catch(e => {}));
}
return Promise.allSettled(queue).then(v => !v.some(v => v.status !== 'fulfilled'));
}
Insert cell
md`---
## References

- https://www.igvita.com/2015/11/20/dont-lose-user-and-app-state-use-page-visibility/
- https://www.tutorialspoint.com/Maximum-size-of-a-canvas-element-in-HTML
- https://medium.com/@homam/making-almost-every-non-interactive-web-page-work-offline-7798ed68baac
`
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