Refinitiv Data Library for TypeScript

Session.Event

Summary

SessionEvent provides a set of events that can be emitted by Session:

Events

SessionEvent.Error

Emits in case of any error that will be passed as a parameter to a callback

Parameters:

  • Error object that contains an error message and a name

SessionEvent.StateChanged

Emits on every state change with the session and the new state as parameters

Parameters:

  • Session
  • State

SessionEvent.EventReceived

Emits on every authentication event

Parameters:

  • Session
  • Event

Session.SessionEventCode

Specifies what type of authentication event is passed:

  • SessionEventCode.AuthenticationFailed

  • SessionEventCode.AuthenticationSucceeded

  • SessionEventCode.RefreshFailed

  • SessionEventCode.RefreshSucceeded


Example of usage

session.on(Session.SessionEvent.StateChanged, (session, state) => console.log('Session state:', state));

session.on(SessionEvent.EventReceived, (session, event) => console.log('Event received:', event));

session.on(SessionEvent.Error, err => console.log(err));