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
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`)
}
}
)
This event is triggered when a fatal error occurs in JMap. The event parameters will give you information about the error.
example
// log a message in the console when a fatal error occurs
JMap.Event.Main.on.fatalError(
"custom-core-fatal-error",
(params) => {
console.log(`A fatal error occured in JMap.
** Context of the error: "${params.context}";
** information about the error: "${params.source}";
** consequence of the error: "${params.action}".`
)
}
)
JMap.Event.Main.on
Here you have all JMap NG Core high level available events on which you can attach a listener.