-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(core): Add lifecycle hooks #7370
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
Conversation
size-limit report 📦
|
I pushed some changes onto this branch to use generics for type safety. I tried it locally and it seems to give me correct type safety as long as you specify the generic. Not sure if there is a way to enforce to provide the generic, not infer it 😅 but you can at least opt into type safety this way, and as an additional plus you only need to edit/add new hook types in a single place now! |
cc @AbhiPrasad & @lforst refactored this again based on our discussion, looks good now I think, and the tests should also cover this decently (both the client & testclient case) |
Closes #7343
This PR adds a basic schema for hooks in the SDK. They live on the client.
Currently there are three hooks defined, but none of them are implemented. They are
beforeTransaction
,transactionFinish
, andbeforeEnvelope
.