• 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.

    Parameters

    • listenerId: string

      Your listener id (must be unique)

    • fn: (() => void)

      Your listener function

        • (): void
        • Returns void

    Returns void

    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`)
    }
    }
    )