Skip to content

Commit

Permalink
Fix newTracker optional typing
Browse files Browse the repository at this point in the history
  • Loading branch information
igneel64 committed Sep 13, 2023
1 parent 027d539 commit c101aad
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@snowplow/browser-tracker",
"comment": "Fix newTracker typing for better understanding of arguments",
"type": "none"
}
],
"packageName": "@snowplow/browser-tracker"
}
2 changes: 1 addition & 1 deletion trackers/browser-tracker/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const state = typeof window !== 'undefined' ? createSharedState() : undefined;
* @param endpoint - Collector endpoint in the form collector.mysite.com
* @param configuration - The initialisation options of the tracker
*/
export function newTracker(trackerId: string, endpoint: string, configuration: TrackerConfiguration = {}) {
export function newTracker(trackerId: string, endpoint: string, configuration?: TrackerConfiguration) {
if (state) {
return addTracker(trackerId, trackerId, `js-${version}`, endpoint, state, configuration);
} else {
Expand Down

0 comments on commit c101aad

Please sign in to comment.