• JMap.Event.Main.on.coreReady

    This event is triggered once:

    • the jmapserverjmapserver-ng-core library is loaded,
    • the redux store and its reducers are also loaded,
    • The initial session validation has been run. 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 core library is loaded
    JMap.Event.Main.on.coreReady(
    "custom-core-ready",
    () => {
    if (JMap.User.getToken() !== "-1") {
    console.log(`Logged in username is: "${JMap.User.getUsername()}"`)
    } else {
    console.log(`No user logged in`)
    }
    }
    )