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

Danfuzz pause default #21

Merged
merged 3 commits into from
Jul 2, 2012
Merged

Danfuzz pause default #21

merged 3 commits into from
Jul 2, 2012

Conversation

danfuzz
Copy link
Contributor

@danfuzz danfuzz commented Jul 2, 2012

This switches the default paused argument on Cat and Valve from false to true. See docs and the main commit for details.

/cc @azulus because I think he's interested.

I'm not going to wait for review, since this is pretty straightforward and I want to move on to adjusting the dependent code. As always, I'm happy to do post-merge tweaks as needed.

Dan Bornstein added 3 commits July 2, 2012 10:32
These had been paused by default, but that can be pretty confusing.

It *used* to be that there was no compelling reason not to start out
paused, but at this point, the module does event sanitization, and that
means there is now a use case for paused == `false` that can be
expected to be common enough.

With this change, the only class that starts out paused is `Blip`,
because there is truly no sense in doing otherwise.
danfuzz added a commit that referenced this pull request Jul 2, 2012
@danfuzz danfuzz merged commit 59d7c7f into master Jul 2, 2012
@@ -222,7 +222,7 @@ function readableTransition() {

var blip = makeErrorBlip(new Error("eek"));
var coll = new EventCollector();
cat = new Cat([blip]);
cat = new Cat([blip], true);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside:

i think it's an antipattern to pass in true/false in methods like this and instead use differently named methods. Since this is a constructor, it may be worth creating factory methods to create Cats, soething like Cat.paused(), etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, point taken. I was on the fence about how to do this. On the one hand, dominant style seems to encourage new Blah() over createBlah(). On the other, what you said.

@davidbyttow
Copy link

LG

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

Successfully merging this pull request may close these issues.

None yet

2 participants