-
Notifications
You must be signed in to change notification settings - Fork 48.5k
Add interaction-tracking/subscriptions #13426
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
Add interaction-tracking/subscriptions #13426
Conversation
} | ||
|
||
export function subscribe(subscriber: Subscriber): void { | ||
subscribers.add(subscriber); |
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.
Shouldn't these be noops if enableInteractionTracking
is false?
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.
Yikes. Yup
} | ||
} | ||
|
||
__subscriberRef.current = { |
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.
This shouldn't bother subscribing if enableInteractionTracking
is false, right?
wrappedInteractions.forEach(interaction => { | ||
interaction.__count--; | ||
try { | ||
returnValue = callback.apply(undefined, arguments); |
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.
Just noticed this... wrapped
is an arrow function here, so these are the arguments to the outer function. Need a test.
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.
Good catch.
Details of bundled changes.Comparing: 5e0f073...f1a3d3c interaction-tracking
Generated by 🚫 dangerJS |
@@ -195,7 +195,7 @@ export function wrap( | |||
interaction.__count++; | |||
}); | |||
|
|||
const wrapped = () => { | |||
const wrapped = (...args) => { |
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.
You could also change this to a normal function :D
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.
It's a nit. I'm just paranoid about the Babel output.
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.
The Babel output is fine. I've checked it. 😄
But sure, I don't mind.
Follow up to PR #13234
enableInteractionTracking
andenableInteractionTrackingObserver
feature flagsinteraction-tracking/subscriptions
bundle