File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
packages/browser/src/browser Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @segment/analytics-next ' : minor
3+ ---
4+
5+ Initialize should actually support getting the initialized analytics instance.
6+
7+ ``` ts
8+ analytics .on (' initialize' ,function ({ analytics }) {
9+ console .log (' initialize' , analytics .user ()) // this works now.
10+ })
Original file line number Diff line number Diff line change @@ -308,7 +308,16 @@ async function loadAnalytics(
308308 )
309309
310310 analytics . initialized = true
311- analytics . emit ( 'initialize' , settings , options )
311+ analytics . emit (
312+ 'initialize' ,
313+ {
314+ writeKey : settings . writeKey ,
315+ cdnSettings : settings . cdnSettings ,
316+ analytics : analytics ,
317+ } ,
318+ /* @deprecated -- can just use analytics.options */
319+ options
320+ )
312321 await flushFinalBuffer ( analytics , queryString , preInitBuffer )
313322
314323 return [ analytics , ctx ]
You can’t perform that action at this time.
0 commit comments