wilsonpage / fastdom

Eliminates layout thrashing by batching DOM measurement and mutation tasks
6.83k stars 240 forks source link

Accept custom context for deferred jobs #12

Closed th507 closed 11 years ago

th507 commented 11 years ago

Just like fastdom.write and fastdom.read, fastdom.defer might be more useful if it could accept custom context.

For example, in addition to supporting current usage, user would be able to pass in callback context like this:

fastdom.defer({
  fn: function() {...}
  ctx: Foo
}, 3);