Skip to content

Commit

Permalink
fix: issue with sync hydrate from parent (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanPiercey committed Nov 27, 2024
1 parent 03554f9 commit 12cb169
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
6 changes: 5 additions & 1 deletion src/node_modules/@internal/gql-query/browser.marko
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { readyLookup } from "@internal/client";

$ const id = component.elId("@gqlc");
$ if (!component.ready && readyLookup[id]) {
component.ready = true;
readyLookup[id]();
}
<div key="root" no-update-if(!component.ready)>
$ component.ready = true;
<gql-query-client
Expand All @@ -14,7 +19,6 @@ import { readyLookup } from "@internal/client";
/>
</div>
$ if (!component.ready) {
const id = component.elId("@gqlc");
readyLookup[id] = () => {
delete readyLookup[id];
component.ready = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,15 @@ class {
}
} else if (input.opKey) {
this.setInput(input);
const hydrate = (ready) => {
hydrateQuery(input.opKey, data, error, input.name);
ready();
}
if (readyLookup[this.id]) {
hydrate(readyLookup[this.id]);
hydrateQuery(input.opKey, data, error, input.name);
readyLookup[this.id]();
} else {
Object.defineProperty(readyLookup, this.id, {
configurable: true,
set: hydrate
});
readyLookup[this.id] = () => {
delete readyLookup[this.id];
hydrateQuery(input.opKey, data, error, input.name);
}
}
}
}
Expand Down

0 comments on commit 12cb169

Please sign in to comment.