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

feat: Add ctx.has #201

Closed
KnorpelSenf opened this issue May 14, 2022 · 1 comment · Fixed by #218
Closed

feat: Add ctx.has #201

KnorpelSenf opened this issue May 14, 2022 · 1 comment · Fixed by #218

Comments

@KnorpelSenf
Copy link
Member

This should be a namespace to query the context object for certain properties, such as whether it contains a command or not.

Once added, this can be reused in the composer, hence improving SoC internally in the library.

@KnorpelSenf KnorpelSenf changed the title Add ctx.has feat: Add ctx.has May 14, 2022
@KnorpelSenf
Copy link
Member Author

It would also be good to have a static Context.has which compiles predicate functions that can be checked fast. Currently, the composer does these things internally, so if we move the checks for each context object, we lose the performance optimisations. Hence, by exposing them statically and re-using these things in the composer, we obtain code with equivalent complexity and constants, while still having a cleaner separation of concerns and better reusability for conversations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant