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

Check, if a service is registered #7

Open
buschtoens opened this issue Sep 16, 2019 · 0 comments
Open

Check, if a service is registered #7

buschtoens opened this issue Sep 16, 2019 · 0 comments

Comments

@buschtoens
Copy link
Owner

buschtoens commented Sep 16, 2019

Currently {{service "unknown-service"}} throws an assertion during render.

Users may want to check, whether a service exists. For this we could either add a second helper, e.g. {{service-exists "unknown-service"}} that returns true / false, or we could add an optional named parameter {{service "unknown-service" throwIfUnknown=false}} and return undefined, if the service is unknown.

I'm not yet convinced that this is a good idea and I did not have the need for it yet. Maybe this kind of logic should be kept in JS.

Looking for opinions / suggestions!

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

1 participant