IIIF-Commons / iiif-helpers

MIT License
3 stars 2 forks source link

JSON Streaming helper #8

Open stephenwf opened 2 years ago

stephenwf commented 2 years ago

Oboejs works roughly like this (with some invented helpers):

// add empty `{id: manifestId, type: 'Manifest'}` to vault.
oboe(manifestId).node('items.*', canvas => {
  addCanvasToVault(canvas);
  return oboe.drop;
});

Which could stream in large manifests and their canvases. You could pause the stream until a user had scrolled or similar.

A general helper to help with streaming large JSON files would be very interesting!