Skip to content

Commit

Permalink
fetch: add progress to full example
Browse files Browse the repository at this point in the history
  • Loading branch information
Fleeym committed Jun 8, 2024
1 parent 1843890 commit 83332f1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tutorials/fetch.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,11 @@ class $modify(MenuLayer) {
}

m_fields->m_listener.bind([] (web::WebTask::Event* e) {
// We don't really care about the request progress, so we won't use it here

if (web::WebResponse* res = e->getValue()) {
log::info("{}", res->string()->unwrapOr("Uh oh!"));
} else if (web::WebProgress* p = e->getProgress()) {
log::info("progress: {}", p->downloadProgress().)
}
} else if (e->isCancelled()) {
log::info("The request was cancelled... So sad :(");
}
Expand Down

0 comments on commit 83332f1

Please sign in to comment.