Merge branch 'main' of github.com:o-development/ldo into feat/svelte

main
Jackson Morgan 4 months ago
commit 16cf3b9b8d
  1. 24
      packages/connected-nextgraph/src/resources/NextGraphResource.ts

@ -122,25 +122,15 @@ export class NextGraphResource
this.loading = true; this.loading = true;
this.emit("update"); this.emit("update");
// Fetch the data once using subscribe // Fetch the data once using construct
await new Promise<void>(async (resolve, reject) => { const sparqlResult = await this.context.nextgraph.ng.sparql_query(
let unsub: () => void;
try {
unsub = await this.context.nextgraph.ng.doc_subscribe(
this.uri,
this.context.nextgraph.sessionId, this.context.nextgraph.sessionId,
async (response: NextGraphNotificationMessage) => { `CONSTRUCT { ?s ?p ?o } WHERE { GRAPH <${this.uri}> { ?s ?p ?o } }`,
if (response.V0.State) { undefined,
unsub(); this.uri,
await this.onNotification(response);
resolve();
}
},
); );
} catch (err) { // Update the dataset
reject(err); this.overwriteQuads(sparqlResult);
}
});
// Update statuses // Update statuses
const result = new NextGraphReadSuccess(this, false); const result = new NextGraphReadSuccess(this, false);

Loading…
Cancel
Save