Custom events dispatched on window. Access data via event.detail.
| Event | Detail | When |
|---|---|---|
rechat-listings:fetched |
IListing[] |
Listings loaded/reloaded from API |
rechat-listing-filters:change |
Filter state object | Any filter or map position changes |
rechat-listing-card:click |
{ listing: IListing } |
Listing card clicked — fires for cards inside the grid/list and for listings picked from the address-search autocomplete's "Listings" section |
rechat-listings-pagination:change |
{ page: number } |
Page changed |
rechat-listing-details:open |
{ listing_id: string } |
A listing's details modal is requested |
rechat-property-search-form:submit |
submitted search values | The standalone search form is submitted |
rechat-login:success |
{ token, provider } |
A visitor signed in (portal sites) |
rechat-saved-search:created |
the saved search | A visitor saved a search (portal sites) |
rechat-error |
{ source: string, error: string } |
API request failed |
window.addEventListener('rechat-listings:fetched', (e) => {
console.log(`${e.detail.length} listings loaded`)
})
window.addEventListener('rechat-listing-card:click', (e) => {
// Fires for listing-grid clicks AND for picks from the address-search
// autocomplete's "Listings" section.
window.location.href = `/properties/${e.detail.listing.id}`
})
window.addEventListener('rechat-error', (e) => {
console.error(`[${e.detail.source}]:`, e.detail.error)
})