AlexsLemonade / AlexsLemonade/refinebio-web

Refactor data fetching logic in SamplesContextProvider using separate useEffect hooks

Open
#460 0 comments 0 reactions 1 assignee Claimed by @nozomione View on GitHub
Post QA
Dominant language
JavaScript
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

### Context

The data fetching in `SamplesContextProvider` is currently handled by a single `useEffect` that triggers when either the `samplesQuery` or `myDataset` state changes. Within this `useEffect`, the `loading` state is set to `true` before making the API call.

### Problem or idea

We want to separate the data-fetching logic into multiple `useEffect` hooks:

- One `useEffect` for setting `loading` to `true` when `samplesQuery` or `myDataset` change.
- Another `useEffect` for making API call when `loading` changes to `true`.

### Solution or next step

Implement the two `usEffect` described above in `SamplesContextProvider`.

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.