-
Notifications
You must be signed in to change notification settings - Fork 26
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
fix(nova/react): fix eventing for multiple nova event interceptors #132
fix(nova/react): fix eventing for multiple nova event interceptors #132
Conversation
@microsoft-github-policy-service agree company="Microsoft" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, just left a 2 comments
packages/nova-react/src/eventing/nova-eventing-provider.test.tsx
Outdated
Show resolved
Hide resolved
I have a hard time understanding the semantics. Are we now able to selectively cancel/handle certain subset of events? can you please update/add the jsdoc comments to explain this? |
The semantics don't change with this bug fix. The event handling with the interceptor can already handle/cancel a certain subset of events. Before this PR there was just a bug that only passed events for the lowest NovaEventInterceptor in the tree. |
When there are multiple interceptors, only the last one is called.
The interceptor is reading 'internal' which always refers to the novaEventing set by eventing provider. When setting the context in the interceptor, the same internal is used instead of creating a new one. The internal in the eventing should point to eventing/unmountEventing created by the interceptor and not the root nova eventing.