Skip to content

Frontend Event

Basic Events

Event NameDescription
createdAfter initialization
mountedAfter data loading
updatedAfter data update
unmountedAfter destruction
list-fetchDuring comment list request
list-fetchedAfter comment list request
list-loadBefore comment loading
list-loadedAfter comment loading
list-failedWhen comment loading fails
list-goto-firstWhen comment list resets
list-reach-bottomWhen comment list reaches bottom
comment-insertedAfter comment insertion
comment-updatedAfter comment update
comment-deletedAfter comment deletion
comment-renderedAfter comment node rendering
notifies-updatedWhen unread messages change
list-gotoDuring comment jump
page-loadedAfter page data update
editor-submitWhen editor submits
editor-submittedAfter editor submission
user-changedWhen local user data changes
sidebar-showWhen sidebar is shown
sidebar-hideWhen sidebar is hidden

Event declaration code: @ArtalkJS/Artalk - src/types/event.ts

Adding Event Listeners

js
artalk.on('list-loaded', () => {
  alert('Comments have been loaded')
})

Removing Event Listeners

js
let foo = function () {
  /* do something */
}

artalk.on('list-loaded', foo)
artalk.off('list-loaded', foo)

Contributors

Changelog