Options
All
  • Public
  • Public/Protected
  • All
Menu

JMap.Application.Event.Main.on

Here you have all JMap NG App high level available events on which you can attach a listener.

Index

Functions

Functions

appReady

  • appReady(listenerId: string, fn: function): void
  • JMap.Application.Event.Main.on.appReady

    This event is triggered once when:

    • all of the application services are loaded,
    • the redux store and its reducers are also loaded,
    • the initial session validation has been executed. At thas point, if the session has successfully been validated, the logged-in user will also be available.
    example
    
    // log a message in the console once the application is loaded
    JMap.Application.Event.Main.on.appReady(
      "custom-app-ready",
      () => {
        if (JMap.User.getToken() !== "-1") {
          console.log(`Logged in username is: "${JMap.User.getUsername()}"`)
        } else {
          console.log(`No user logged in`)
        }
      }
    )

    Parameters

    • listenerId: string

      Your listener id (must be unique)

    • fn: function

      Your listener function

        • (): void
        • Returns void

    Returns void