Skip to content
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

Update tutorial.html #587

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions src/documents_en/v2/guide/tutorial.html
Original file line number Diff line number Diff line change
Expand Up @@ -1253,13 +1253,11 @@
get();

// at the bottom of the list get the next set of results and append them
target.onInfiniteScroll = (done) => {
target.onInfiniteScroll = async (done) => {
if (url) {
setTimeout(() => {
get();
done();
}, 200);
await get();
}
done();
};
}
});
Expand All @@ -1273,11 +1271,6 @@
we'll add in a minute). We need to use `setTimeout` because otherwise the
results could get spliced, I think.

> `setTimeout` waits for 200ms here just so you can see the spinner in action.
> This is just an arbitrary wait, so feel free to set it to `0` to speed things
> up. However, what you _can't_ do is remove `setTimeout` altogether and just
> call `get`. This will splice the results as mentioned already.

We'll also add a spinner so that when the user reaches the end of the page, a
spinner is shown while the next results are being loaded. Add this to the body
of `pokemon.html` after the `ons-list` definition:
Expand Down