w3c / requestidlecallback

Cooperative Scheduling of Background Tasks
https://w3c.github.io/requestidlecallback/
Other
50 stars 19 forks source link

Future-proof the rIC API and make it extensible. #22

Closed rmcilroy closed 8 years ago

rmcilroy commented 8 years ago

Changes the second argument to requestIdleCallback from a raw timeout to an IdleRequestOptions dictionary which can have a timeout property.

Addresses issue #21.

toddreifsteck commented 8 years ago

Spec LGTM. /cc @eliperelman @bzbarsky for a second review.

bzbarsky commented 8 years ago

Looks mostly good, except the options argument can never be omitted; optional dictionary arguments always have an implicit default value of null (which ends up behaving more or less identically to an empty dictionary, to a first approximation). So you don't have to talk about it being omitted.

igrigorik commented 8 years ago

@bzbarsky @rmcilroy would present be more appropriate here?

bzbarsky commented 8 years ago

The dictionary member can be present or not present. The dictionary is just there.

rmcilroy commented 8 years ago

Would it work to just replace that text with "If options contains a timeout property with positive value"?

bzbarsky commented 8 years ago

I would put it like this:

If the timeout property is present in options and has a positive value, ...
rmcilroy commented 8 years ago

SGTM, changes made in 712579a

igrigorik commented 8 years ago

@bzbarsky @rmcilroy great stuff, thanks! Merging.