holochain-open-dev / holochain-open-dev/infrastructure

Follow-up liveLinkStore first fetch with regular fetch immediately

Open
#107 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
7
Forks
1
PR merge metrics
No merged PRs in 30d

Description

I don't have permissions to make a pull request, but I would suggest something like this on main-0.5 in packages/stores/src/holochain.ts:485

```
const fetch = async () => {
if (!active) return;
if (isFirstFetch) {
isFirstFetch = false
const firstLinks = await firstFetchLinks();
maybeSet(firstLinks);
}
const nlinks = await fetchLinks().finally(() => {
if (active) {
setTimeout(() => fetch(), pollIntervalMs);
}
});
maybeSet(nlinks);
};
```

This would allow an immediate network call followup after a local fetch, to remove unnecessary waiting time for network data.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.