Back to Consul

EventSource

ui/packages/consul-ui/app/components/event-source/README.mdx

1.22.7814 B
Original Source

EventSource

hbs
<EventSource
  @src={{eventSourceObject}}
  @onerror={{action 'error'}}
/>

Arguments

ArgumentTypeDefaultDescription
srcEventSourceProxyAn EventSource object
onerrorFunctionThe action to fire when an error occurs. Emits ErrorEvent object with an error property containing the Error.
closeOnDestroyBooleantrueWhether to close and destroy the event source when the component is destroyed

This component is used to configure event source error from within a template, but also ensures that EventSources are cleaned/up destroyed when the user leaves the page (when the component is removed from the page)

See