FACN1 / week3-javiasy

Repo to hold GOT actor app
https://facn1.github.io/week3-javiasy/
0 stars 2 forks source link

setTimeout on scroll #45

Open emilyb7 opened 7 years ago

emilyb7 commented 7 years ago
setTimeout(function() {
                    document.getElementById('characterList').scrollIntoView();
                }, 2000);

is there a reason why we wait 2 seconds for the page to scroll? it makes everything very slow.

If it's because we're waiting for an API response, have you tried other ways of doing this?

emilyb7 commented 7 years ago

It's taken me a while to figure out what you're trying to do, but I'm guessing that the problem is this...

You make a lot of requests (because there needs to be a request for each character running in parallel). So you don't know when the requests are going to finish?

Have you tried to work out how you could do this without the setTimeout? I believe you covered this in the parallel morning challenge on Tuesday, so maybe you already know and didn't get round to implementing it in time...

macintoshhelper commented 7 years ago

Fixed in 311866c (I had already done this locally, but hadn't pushed the branch). This gets called every time a list item is added. I haven't implemented a parallel function yet, this would be a good way to run things once it's finished the requests.