templates(remix-tutorial): Add artificial delay to contact retrieval for demonstration #10475
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add Loading Delay to Contact Fetch Operation
Closes: # (no specific issue to close)
[x] Tests
[ ] Docs
Changes Made
Added a 500ms artificial delay to the
getContact
function to simulate network latency in the contact fetching operation. This change helps to demonstrate loading states in the UI more effectively during the tutorial.Testing Strategy
This change can be tested by:
The delay is implemented using a Promise-based setTimeout, which is a common pattern for simulating network conditions in demo applications.
Impact
This is a minor change that only affects the tutorial example and does not impact any core functionality. The delay is small enough to maintain a good user experience while being long enough to demonstrate loading states effectively.