-
-
Notifications
You must be signed in to change notification settings - Fork 277
feat: before breadcrumb and scope ref #122
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
Conversation
| clone.addBreadcrumb(breadcrumb); | ||
| } | ||
|
|
||
| for (final eventProcessor in _eventProcessors) { |
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.
Since we're in the class, what about a private constructor or factory method that takes all fields as named args?
Then we could just clone all lists etc like Scope({eventProcessors = [...this.eventprocessors]) and avoid tall these for
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.
mm yeah but rethinking this right now, maybe it'd make sense to just do a copyWith and follow the convention? tbh I just added the missing field in the existent method, I will check whats the state of the art for cloning objects on Dart.
Factory is public afaik, but a private ctor would work as well
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.
https://pub.dev/documentation/copyable/latest/#examples
using the copyable interface seems to be the standard
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.
I will add this as a task on our project, so I can merge this now
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.
copyWith is probably the "most standard way" ( used a lot in Flutter source code, and in https://pub.dev/packages/freezed, a popular immutable package)
📢 Type of change
📜 Description
feat: before breadcrumb and scope ref
💡 Motivation and Context
One should be able to filter breadcrumbs on before breadcrumb callback and also add event processors to the scope
💚 How did you test it?
📝 Checklist
🔮 Next steps
Contexts is still missing