Options
All
  • Public
  • Public/Protected
  • All
Menu

Module on

JMap.Event.User.on

Here you have all available user events on which you can attach a listener.

Index

Functions

Functions

sessionChanged

  • sessionChanged(listenerId: string, fn: function): void
  • JMap.Event.User.on.sessionChanged

    This event is triggered when the user session has changed.

    If it's a logout, the accessToken in params.session is equal to "-1".

    example
    
    
    // Each time the session has changed this method is processed
    JMap.Event.User.on.sessionChanged(
       "custom-session-change",
       params => {
         if (params.session.accessToken === "-1") {
           console.log("Session has been closed", params.session)
         } else {
           console.log(`New session opened`, params.session)
         }
       }
    )

    Parameters

    Returns void