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

Do something until a feature is enabled #29

Open
cjsaylor opened this issue Jul 7, 2016 · 0 comments
Open

Do something until a feature is enabled #29

cjsaylor opened this issue Jul 7, 2016 · 0 comments

Comments

@cjsaylor
Copy link
Member

cjsaylor commented Jul 7, 2016

When we want to do something until a feature is enabled, we have to do something like:

$swivel
  ->forFeatutre('Shiny')
  ->addBehavior('new', function() {})
  ->defaultBehavior(function() {
    // Do normal stuff until Shiny.new is enabled
  })
  ->execute();

Proposal, add a new manager type that executes all behaviors until the feature is enabled:

$swivel
  ->untilFeature('Shiny')
  ->addBehavior('new', function() {
    // Do normal stuff until Shiny.new is enabled
  })
  ->execute();

Invoke form would be:

$swivel->invokeUntil('Shiny.new', function() {
  // Do normal stuff until Shiny.new is enabled
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants