Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an onFlush callback for hooking to ngMock.timeout, sinon fake-timers, etc. #89

Open
jamestalmage opened this issue Jul 21, 2015 · 2 comments

Comments

@jamestalmage
Copy link
Contributor

Something like:

ref.onFlush(function(){
  $timeout.flush();
  // or
  clock.tick();
});

Need to think through the API, and how it would interact with autoFlush, etc.

Just putting the idea out there.

@bendrucker
Copy link
Collaborator

Any reason why this would be needed over just monkey patching flush?

@jamestalmage
Copy link
Contributor Author

I don't know, it just popped in my head while reading #87.

I'd need to actually try it on a project first, and see if it had utility. It does seem I commonly $timeout.flush() after ref.set, but not sure what the implication would be.

We could certainly make this easier to toggle on and off than a monkey patch would be.

Like I said, just spitting out an idea.

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

No branches or pull requests

2 participants