Skip to main content

TurboFrameRefreshController

Purpose​

Refresh the contents of a remote turbo frame.

Actions​

ActionPurpose
refreshSets the src of the connected <TurboFrame> to the same value it already has, triggering a content re-load

Targets​

TargetPurposeDefault
---

Classes​

ClassPurposeDefault
---

Values​

ValueTypeDescriptionDefault
pollBooleanWhether the the <turbo-frame> should periodically refresh itselffalse
interval (Optional)NumberThe time, in milliseconds, between each refresh of the frame.-

Events​

EventWhenDispatched onevent.detail
----

Side Effects​

Sets a timeout on the window using setTimeout if pollValue is true.

How to Use​

HTML​

<turbo-frame src="/feed" data-controller="turbo-frame-refresh" data-turbo-frame-refresh-poll-value="true" data-turbo-frame-refresh-interval-value="10000" />