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

Chaining procedure #203

Open
blechatellier opened this issue Sep 5, 2024 · 2 comments
Open

Chaining procedure #203

blechatellier opened this issue Sep 5, 2024 · 2 comments

Comments

@blechatellier
Copy link

This is a suggestion for chaining procedure, it would be good to have a .use() instead of having to pass the chained procedure as an argument to another procedure, makes things a bit difficult to nest.

@IdoPesok
Copy link
Owner

IdoPesok commented Sep 8, 2024

Hi, can you share an example to showcase current limitations and where .use will shine? Will help me understand the root problem.

@blechatellier
Copy link
Author

I have a procedure for logging, one for checking user auth, another one for rate limiting.

At the moment I need to do something like loggingProcedure(authProcedure(rateLimitingProcedure)). If I want to pass in some arguments to the procedure (ie: roles to check for auth), I need to nest them loggingProcedure(authProcedure(roles)(rateLimitingProcedure)). It's all possible to do as it is but a chaining method like .use() would help for readability and composability.

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

2 participants