Dan Schlosser

Results 43 comments of Dan Schlosser

Unfortunately, this isn't possible cleanly. The goal of this library is to be able to provide a smooth scrolling experience, and the tactic is for the library to understand (load...

can you break up the images into groups? The first group gets computed all at once, and rendered, then the second group, and so-on. You'd have a new Pig instance...

For your cloud provider, you're saying that there's no way to generate the final image URL without hitting an API? As in, you're not storing each image size at a...

Ah, I follow now, yes. AbortController only works with fetch, but yes if the issue is on the server getting overloaded (vs the client being overloaded), then preventing the calls...

Are you able to measure / log exactly which images are being loaded unexpectedly to be sure that unnecessary ones are being loaded? It's worth noting that the library does...

if it comes to that, you could implement a scroll speed measure by using the `lastYOffset` (https://github.com/schlosser/pig.js/blob/master/src/pig.js#L655) and also capturing `lastYOffsetCaptureTime` and doing a speed calculation with `(lastYOffset - currentYOffset)...

Hmm, could be a bug in pig. What's supposed to happen is `_doLayout` should be getting called as you scroll, and images outside the viewport should have `.hide()` called on...

My cursory testing seems to work: if I change the 100ms to 5000ms and scroll down the page at a steady, speedy rate for 10-15s, I see no images loading,...

Ah yes, makes sense, that's because hide() is not being called. Do you think that scroll pattern is reasonable to test against? If an image is in the viewport for...

I mean instantiating `Pig` with options: ```js new Pig(imageData, { primaryImageBufferHeight: 0, secondaryImageBufferHeight: 0, }); ``` Give that a try! I think it will be more aggressive about not loading...