Intermediate
Keep What Arrived
This route sends part of an answer and then the connection breaks. Right now the page throws the partial text away.
When #ask is clicked, show the pieces in #answer as they arrive. If the stream breaks, keep the text and show The answer was cut off. Please try again. in #error. If the stream completes normally, #error stays empty.
What Check tests
- After the first click, the partial text is still in
#answer #errorsaysThe answer was cut off. Please try again.- A second click gives the full answer and clears the error
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
Runs in your browser. Your code is saved here.
Your page
Press Run to see the page.
Console
Nothing logged yet.