Skip to content

Follow-up liveLinkStore first fetch with regular fetch immediately #107

@LeosPrograms

Description

@LeosPrograms

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions