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 Bundle dequeue() and when() methods #234

Merged
merged 2 commits into from
Jun 26, 2022
Merged

✨ add Bundle dequeue() and when() methods #234

merged 2 commits into from
Jun 26, 2022

Conversation

QWp6t
Copy link
Member

@QWp6t QWp6t commented Jun 26, 2022

You can now dequeue and conditionally load bundles.

// directly pass boolean value
bundle('shop')->when(is_shop())->enqueue();

// pass named function to be resolved
bundle('shop')->when('is_shop')->enqueue();

// pass closure to be resolved
bundle('shop')->when(fn () => is_shop())->enqueue();
bundle('shop')->enqueue();

// o nvm i changed my mind

bundle('shop')->dequeue();

closes #196

@QWp6t QWp6t merged commit b8b5ecc into main Jun 26, 2022
@QWp6t QWp6t deleted the bundle-features branch June 26, 2022 17:47
QWp6t added a commit that referenced this pull request Jun 26, 2022
* ✨ add Bundle::when() helper method
* ✨ add Bundle::dequeue() methods
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.

Feature Request: bundle()->dequeue
1 participant