katowulf/mockfirebase — pull request #49 by katowulf (2014-12-29 19:28:13+00:00)
Title: Update flush to allow for more granular controls

This looks like an extensive change but it's actually fairly simple and low-risk (just touches a lot of code points because it modifies _defer().

Adds:
* `getFlushQueue()` which returns FlushQueue objects with cancel() and run() methods.

Removes:
* `joinFlushQueue()`
* `splitFlushQueue()`

Essentially, this allows events in the flush queue to be run or canceled at a granular level. I'll be using it in Firebase.util for some advanced testing scenarios where I need to flush some events that are occurring in deeply nested libs, but not others. All of these are items I can't access directly without great complexity, which prompted this enhancement.

See the API.md changes for details on how it works--I think you'll see that it's pretty sweet.