How to use the rdf-ext.waitFor function in rdf-ext

To help you get started, we’ve selected a few rdf-ext examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wikibus / Alcaeus / src / MediaTypeProcessors / RdfProcessor.ts View on Github external
function serializeDataset (dataset) {
    const stream = jsonldSerializer.import(dataset.toStream())

    let result
    stream.on('data', (data) => {
        result = data
    })

    return $rdf.waitFor(stream).then(() => {
        return result
    })
}