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

Support multiple calls to onINP() with different config options #583

Open
wants to merge 8 commits into
base: v5
Choose a base branch
from

Conversation

philipwalton
Copy link
Member

@philipwalton philipwalton commented Dec 20, 2024

Fixes #582.

This PR updates the interactions.ts logic to encapsulate it in a class that can be instantiated per onINP() call. It also moves most of the functions in the attribution/onINP.ts file inside of the onINP() closure, to keep all of the variables local to each onINP() call.

The main downside of this PR is it increases the bundle size of the library (since object properties don't minify as well as instance variables), but I added an additional terser config option to mangle object properties that begin with a $ character, which negates much of the increased size (at the expense of being a bit annoying to write).

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

Successfully merging this pull request may close these issues.

1 participant