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

Keep the same ctx object for all hooks #53

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mcfedr
Copy link
Contributor

@mcfedr mcfedr commented May 31, 2022

by coping the ctx object we prevent a hook from using it to track the request, this changes the code to keep the same object

e.g. I'm added a hook on requestRouted that does ctx.somefield = somevalue and later in responseSent I'm able to access that value. This currently works for all hooks except requestRouted.

I've also made a couple of CI changes, to run the make file in example, so that we check that the same code is kept up to date, and the same with the __mock__ that is used in tests as it was outdated.

@mcfedr mcfedr marked this pull request as draft May 31, 2022 14:13
@mcfedr mcfedr marked this pull request as ready for review May 31, 2022 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant