Skip to content

Deduplicate api call for FCC Course completion -> dev #601

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 23, 2023

Conversation

vas3a
Copy link
Collaborator

@vas3a vas3a commented Apr 21, 2023

Deduplicates api calls for FCC course completion.

@vas3a vas3a self-assigned this Apr 21, 2023
Copy link

@maxtopc maxtopc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vas3a question: wouldn't the "isUpdating" variable simply get reset at every call of the function? Are we sure it retains its value? 🤔 I would think we would have to do useState or some other way for it to persist its value? (I'm not saying the useState is the best way to do that, but I just think that isUpdating might not retain its value this current way?).

@vas3a
Copy link
Collaborator Author

vas3a commented Apr 21, 2023

@maxtopc I'm using useRef which retains the value but at the same time it doesn't trigger a state update - exactly what we want.
Similarly useState will keep the value, but would also trigger a state update, which we don't need.

@maxtopc
Copy link

maxtopc commented Apr 21, 2023

Ah, okay, great! Thank you!

Copy link
Collaborator

@kkartunov kkartunov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

@vas3a vas3a merged commit 7591244 into dev Apr 23, 2023
@vas3a vas3a deleted the dedupe-api-call-for-fcc-cert-completion branch April 24, 2023 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants