Skip to content

[React] Add cache to resolve hook to allow for efficient larger queries #54

@fotmjay

Description

@fotmjay

Problem

Considering hooks can't be used conditionally, parsing through a large list of domains (or addresses) to fetch their counterpart will lead to multiple re-fetch of the same addresses/domains. Currently, this could be circumvented by not using the hook and instead using the vanilla implementation along with a cache.

Proposed Solution

Add a cache state to the hooks, preserving the truthiness (official latest current value) while reducing stress on the router for any doubles.

Implementation

  • Adding a domain cache state to the hook.
  • Verifying the cache before fetching the data.
  • Returning the cache instead of newly fetched data.
  • Updating the cache with the result whenever a domain/address is fetched.

If you think this would be a good addition , you may assign it to me. I can work on it.

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