Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

optimize debounce pattern in pf 3.0 #514

Closed
aFarkas opened this issue Jun 9, 2015 · 4 comments
Closed

optimize debounce pattern in pf 3.0 #514

aFarkas opened this issue Jun 9, 2015 · 4 comments
Labels
Milestone

Comments

@aFarkas
Copy link
Collaborator

aFarkas commented Jun 9, 2015

See discussion here

@mike-engel mike-engel added this to the Version 3.0 milestone Jun 10, 2015
@aFarkas
Copy link
Collaborator Author

aFarkas commented Jun 12, 2015

@baloneysandwiches
Do you want to take this?

@albell
Copy link
Collaborator

albell commented Jun 22, 2015

Yes. I would prefer to localize all debouncing logic in a single function and not have timer stuff sprinkled all around, if possible. I would like to get rid of resizeThrottle if we can. Looking at:

https://github.com/scottjehl/picturefill/blob/afarkas-pf3-proposal/src/picturefill.js#L1324-L1327

is there a reason we need this? Is resize ever going to happen before setupRun?

@aFarkas
Copy link
Collaborator Author

aFarkas commented Jun 22, 2015

This line is a micro optimization. If a developer calls the API while we wait for a debounced call, we abort the debounced call. Due to the fact that this won't happen so often... you are free to remove it.

@albell
Copy link
Collaborator

albell commented Jun 23, 2015

I took a quick stab at this but it's failing a handful of functional tests. I suspect this has to do with the async tests not playing well with the debounce timer. I hesitate to go build delays into the tests to make them pass. Can you take a look?

albell@2925378

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants