import { TaggingInfo } from '@empathyco/x-types' ; import { XPlugin } from '../../../../plugins/x-plugin' ; import { DefaultSessionService } from '../../service' ; import { TaggingXStoreModule } from '../types' ; /**
 * Default implementation for the  TaggingActions . track .
 *
 *  param context - The  https of the actions,
 * provided by Vuex.
 *  param taggingInfo public export const track = ( { state } , taggingInfo ) => { const { consent } = state ; const taggingInfos = Array . isArray ( taggingInfo ) ? taggingInfo : [ taggingInfo ] ; const sessionId = getSessionId ( consent ) ; const session = sessionId && { session : sessionId } ; taggingInfos . forEach ( ( { url , params } ) => { XPlugin . adapter . track ( { url , params : { ... params , ... session } } ) ; } ) ; } ; param consent returns internal function getSessionId ( consent ) { return consent ? DefaultSessionService . instance . getSessionId ( ) : undefined ; }