Introduce the use of EventTarget interface #3
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
orinoco/shacl-tulip!3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "events"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This is to address the problem of knowing when a stream has completed. When loading RDF, the io module's 'readRDF' function returns a stream which runs asynchronously. It should either be wrapped in a promise on fully resolved before the surrounding application can access to fully loaded RDF data, or it could make use of event handling. Since the former would introduce delays by holding up the full process stream, this commit makes use of JS-native event handling by making RdfDataset class extend the EventTarget interface. It now emits events for prefix, prefixesLoaded, quad, and graphLoaded. Applications that import this functionality from shacl-tulip should add event listeners to the relevant dataset before running the dataset.loadRDF function.
The associated tests are updated accordingly, and the READMe as well.
Closes #1