Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix docs examples #426

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 8, 2020
Merged

Fix docs examples #426

merged 3 commits into from
Oct 8, 2020

Conversation

sake92
Copy link
Contributor

@sake92 sake92 commented Oct 7, 2020

Improvements:

  • openweathermap didnt work (needs an API key), so I used another free API :D
  • websockets didnt work when using https, it has to be wss (secure socket)..
  • 2 cosmetic changes

Copy link
Member

@sjrd sjrd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a few formatting comments, but otherwise LGTM.

"http://api.openweathermap.org/" +
"data/2.5/weather?q=Singapore"
)
xhr.open("GET", "https://www.boredapi.com/api/activity")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These examples show up in the final document next to their output, and hence they only have ~40 characters a line. We should try to keep lines as short as possible:

Suggested change
xhr.open("GET", "https://www.boredapi.com/api/activity")
xhr.open("GET",
"https://www.boredapi.com/api/activity")

xhr.onload = { (e: dom.Event) =>
if (xhr.status == 200) {
pre.textContent =
xhr.responseText
pre.textContent = xhr.responseText
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same problem here. The previous formatting was better for the short line width.

val url =
"http://api.openweathermap.org/" +
"data/2.5/weather?q=Singapore"
val url = "https://www.boredapi.com/api/activity"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
val url = "https://www.boredapi.com/api/activity"
val url =
"https://www.boredapi.com/api/activity"

@sake92
Copy link
Contributor Author

sake92 commented Oct 8, 2020

Makes sense. All addressed now! @sjrd

@sjrd sjrd merged commit 803a788 into scala-js:master Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants