We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 387c21f commit 60603d2Copy full SHA for 60603d2
wasm/example/src/main.py
@@ -1,13 +1,12 @@
1
-from browser import fetch
+from browser import fetch, alert
2
3
def fetch_handler(repos):
4
star_sum = 0
5
for repo in repos:
6
star_sum += repo['stars']
7
- print(f'Average github trending star count: {star_sum / len(repos)}')
8
-
+ alert(f'Average github trending star count: {star_sum / len(repos)}')
9
10
fetch(
11
'https://github-trending-api.now.sh/repositories',
12
response_format='json',
13
-).then(fetch_handler)
+).then(fetch_handler, lambda err: alert(f"Error: {err}"))
0 commit comments