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

Move event threshold to a configurable option of the library #48

Merged
merged 4 commits into from
Jan 13, 2024

Conversation

elchininet
Copy link
Owner

The event threshold was a constant with 50, any consecutive events with a lower timestamp than this value were ignored. This pull request moves this value from a constant to a configurable option of the library, so it is possible to change it when one instantiates the class. With this pull request, the default value has been changed from 50 to 450, so if s lower value is needed it should be sent during instantiation.

config optional parameter

{
    retries?: number;
    delay?: number;
    eventThreshold?: number;
}
Parameter Optional Description
retries yes How many retries trying to find an element in the DOM tree before giving up (defaults to 100)
delay yes Delay between each retry trying to find an element in the DOM tree (defaults to 50)
eventThreshold yes Timestamp threshold to fire an event. If two consecutive events of the same type have a timestamp difference lower than this value, the second event will be ignored (defaults to 450)

@coveralls
Copy link

coveralls commented Jan 13, 2024

Coverage Status

coverage: 100.0%. remained the same
when pulling 49eca5d on add_event_theshold_to_the_config
into 39c1151 on master.

@elchininet elchininet merged commit 6317f3b into master Jan 13, 2024
2 checks passed
@elchininet elchininet deleted the add_event_theshold_to_the_config branch January 13, 2024 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants