You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR was squashed before being merged into the main branch.
Discussion
----------
feat: add Encore.when()
Replace #900 by adding a more generic and flexible API than `Encore.isDev()`/`Encore.isProd()`, see #900 (comment).
`Encore.when()` takes two parameters:
- `condition`: can be a callback (where the current instance of Encore is passed as first parameter) or a boolean. If this results to `true`, the parameter `callback` is called
- `callback`: executed when parameter `condition` results to `true`, it takes the current instance of Encore as first parameter
WDYT? Thanks!
Commits
-------
8082c61 feat: add Encore.when()
0 commit comments