clean frontend disconnection protocol

This commit is contained in:
Yeicor
2024-03-16 10:54:26 +01:00
parent aef047a658
commit e85dc36fea
10 changed files with 280 additions and 145 deletions

View File

@@ -12,9 +12,10 @@ export let extrasNameValueHelpers = "__helpers";
*
* Remember to call mergeFinalize after all models have been merged (slower required operations).
*/
export async function mergePartial(url: string, name: string, document: Document): Promise<Document> {
export async function mergePartial(url: string, name: string, document: Document, networkFinished: () => void = () => {}): Promise<Document> {
// Load the new document
let newDoc = await io.read(url);
networkFinished()
// Remove any previous model with the same name
await document.transform(dropByName(name));