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

refactoring observer options #826

Merged
merged 1 commit into from
Feb 5, 2022
Merged

refactoring observer options #826

merged 1 commit into from
Feb 5, 2022

Conversation

Yuyz0112
Copy link
Member

@Yuyz0112 Yuyz0112 commented Feb 4, 2022

This PR does not have any functional change to the library, just a code refactoring to the rrweb's observer module.

Previously, we are repeating the type of parameters many times across the code base, after the refactoring, most parameters are using the same interface.

Also, we are changing the function parameters from multiple arguments into a single object argument and using destructing to access the properties, which reduces the mistakes of passing arguments with the same type in the wrong order.

Copy link
Contributor

@Juice10 Juice10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! So much cleaner, less repetitive and much easier to add something without having to change it in 4 or 5 places. Well done!

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.

2 participants