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

Feature/optional strict mode #237

Merged
merged 6 commits into from
Dec 17, 2023

Conversation

zoff4ick
Copy link
Contributor

  • tests and linter show no problems (npm t)
  • tests are added/updated for bug fixes and new features
  • code is properly formatted (npm run fmt)
  • description of changes is added in CHANGELOG.md
  • update .d.ts typings

@zoff4ick
Copy link
Contributor Author

Hello. On our last Q&A meeting we discussed that it would be useful to have a strict mode in data collector. Exact question in the video (https://youtu.be/OuHazDcfh7k?si=Vqw-Rz8CWKy1po8y&t=6550) (link with timecode)

By default we can reassign values of keys as many times as we want (at least as long as collector has done === false). But sometimes we don't need an ability of reassigning values and we want to work with less mutable structures/collections to prevent some uncontrolled changes/mutations. So I implemented the optional key "allowReassignment" in the collector's options. So if we want want to disable mutation of values for already assigned keys (those whom already store values) we should pass allowReassignment: false to options.

Copy link
Member

@tshemsedinov tshemsedinov left a comment

Choose a reason for hiding this comment

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

Please rename allowReassignment to reassign

@zoff4ick
Copy link
Contributor Author

Please rename allowReassignment to reassign

done

lib/collector.js Outdated Show resolved Hide resolved
lib/collector.js Outdated Show resolved Hide resolved
lib/collector.js Outdated Show resolved Hide resolved
test/collector.js Outdated Show resolved Hide resolved
test/collector.js Outdated Show resolved Hide resolved
@tshemsedinov tshemsedinov merged commit 248ac81 into metarhia:master Dec 17, 2023
10 checks passed
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.

3 participants