Skip to content
Discussion options

You must be logged in to vote

Do you mean like in a unit test? Assuming you've mocked your actual API call method, you can define the mock implementation to have a delay before it resolves and use this to check the loading state. If you are using jest (or something with a similar API) the useFakeTimers method will be useful here to manually advance your time so you don't run into race conditions.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by EvanHammond
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants