LogoLogo
InstallSource CodeIssuesSupport
v1.x
v1.x
  • Introduction
  • Essentials
    • Installation
    • Configuration
    • Creating Components
    • Rendering Views
    • Data Properties
    • Actions
    • Events
    • Lifecycle Events
  • Component Features
    • Redirecting
    • Logging
  • Templates
    • Loading States
    • Polling
    • Prefetching
    • Offline State
    • Dirty States
    • Defer Loading
  • JS Integrations
    • AlpineJS
    • Inline Scripts
  • Testing
  • Security
  • Troubleshooting
  • CommandBox Commands
Powered by GitBook
On this page

Was this helpful?

  1. Templates

Polling

You can add a wire:poll annotation to your elements to poll for changes for a set interval. By default, this interval is set to every 2 seconds.

<div wire:poll>
    Current time: #now()#
</div>

You can append a different interval time to your annotation as well.

<div wire:poll.5000ms>
    Current time: #now()#
</div>

Polling for changes over AJAX is lightweight and is often a good alternative to strategies such as Pusher or WebSockets.

Invoking Method

If you would like to invoke a method during each poll interval, you can do so by specifying a method name.

<div wire:poll="checkIfCoffeeIsReady">
    Current time: #now()#
</div>

PreviousLoading StatesNextPrefetching

Last updated 3 years ago

Was this helpful?