@shopgate/pwa-tracking
Version:
Tracking library for the Shopgate Connect PWA.
6 lines • 752 B
JavaScript
import{userDidLogin$,userDataReceived$,registrationSuccess$ as registrationSuccessCore$,REGISTRATION_FORM_LOGIN_STRATEGY}from'@shopgate/engage/user';/**
* Gets triggered if login was successful and we received the user data.
*/export var loginSuccess$=userDidLogin$// Do not track a login when user was automatically logged in after registration
.filter(function(_ref){var action=_ref.action;return(action===null||action===void 0?void 0:action.strategy)!==REGISTRATION_FORM_LOGIN_STRATEGY;}).switchMap(function(){return userDataReceived$.first();});/**
* Gets triggered if registration was successful and we received the user data.
*/export var registrationSuccess$=registrationSuccessCore$.switchMap(function(){return userDataReceived$.first();});