Apollo Elements Apollo Elements Guides API Blog Toggle darkmode

Helpers: Events

<apollo-client> listens for apollo-element-connected and apollo-element-disconnected events to manage their client reference.

const APOLLO_ELEMENTS = new Set();

window.addEventListener('apollo-element-connected', event =>
  APOLLO_ELEMENTS.add(event.detail));

window.addEventListener('apollo-element-disconnected', event =>
  APOLLO_ELEMENTS.delete(event.detail));

ApolloEvent

Properties

public

type

ApolloEventType
public

controller

ApolloController | undefined

ApolloElementEvent

Fired when an ApolloElement connects to or disconnects from the DOM

Properties

public static

type

inherited from ApolloEvent
ApolloEventType
public static

type

inherited from ApolloEvent
ApolloEventType
public

controller

inherited from ApolloEvent
ApolloController | undefined

ApolloControllerEvent

Properties

public

controller

inherited from ApolloEvent
ApolloController | undefined
public

type

inherited from ApolloEvent
ApolloEventType

ApolloControllerConnectedEvent

Fired when a controlled element connects to the DOM

Properties

public static

type

inherited from ApolloEvent
ApolloEventType
public static

type

inherited from ApolloEvent
ApolloEventType
public

controller

inherited from ApolloEvent
ApolloController | undefined

ApolloControllerDisconnectedEvent

Fired when a controlled element disconnects from the DOM

Properties

public static

type

inherited from ApolloEvent
ApolloEventType
public static

type

inherited from ApolloEvent
ApolloEventType
public

controller

inherited from ApolloEvent
ApolloController | undefined

Exports

import {
  ApolloEvent,
  ApolloElementEvent,
  ApolloControllerEvent,
  ApolloControllerConnectedEvent,
  ApolloControllerDisconnectedEvent
} from '@apollo-elements/core/events';