API reference up.radio
module

Features to update fragments without a user click.

An element with [up-hungry] is updated whenever a server response contains a matching element, even when the response was requested for a different target. This keeps things like unread counters current with every request. [up-flashes] builds on this to show confirmations and alerts from any response, including responses rendered in an overlay. An element with [up-poll] reloads itself from the server periodically, and up:fragment:poll lets your code skip a scheduled reload.


Features

  • Use an [up-flashes] element to show confirmations, alerts or warnings.

  • Before an [up-hungry] element is added to a render pass, an event up:fragment:hungry is emitted on that element.

  • This event is emitted before a polling fragment is reloaded from the server.

  • Elements with an [up-hungry] attribute are updated whenever the server sends a matching element, even if the element is not targeted.

  • [up-poll] ATTR

    Elements with an [up-poll] attribute are reloaded from the server periodically.

  • Configures defaults for passive updates.

  • Starts polling the given element.

  • Stops polling the given element.