-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: pass tracker's config into TrackRequest (#210)
This PR improves the ergonomics of `TrackRequest`. The user callback now receives a `Config` directly, which can be accessed to provide parameters for the request. An alternative would be directly exposing the `Config` as a public variable of `Tracker`, or forcing the user to instead reference the config returned from a call to `cfg, tracker := client.Config(..)`. Those alternatives are not great, because they make the user carry around the config and manually inject it into the callback. This way, the callback can be defined wherever and not need to worry about how to receive the config.
- Loading branch information
1 parent
215116a
commit 8321db6
Showing
2 changed files
with
33 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters