Skip to content

Commit 5cbf302

Browse files
committed
Update Poll.vue
1 parent 5eaa4bf commit 5cbf302

File tree

1 file changed

+12
-2
lines changed
  • playgrounds/vue3/resources/js/Pages

1 file changed

+12
-2
lines changed

playgrounds/vue3/resources/js/Pages/Poll.vue

+12-2
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,25 @@ const trigegerAsyncRedirect = () => {
2828
)
2929
}
3030
31-
const { stop } = usePoll(
31+
const { start, stop } = usePoll(
3232
2000,
3333
{
3434
only: ['asdf'],
3535
onFinish() {
3636
hookPollCount.value++
3737
},
3838
},
39-
false,
39+
{
40+
keepAlive: true,
41+
startOnMount: false,
42+
},
4043
)
4144
4245
onMounted(() => {
46+
setTimeout(() => {
47+
start()
48+
}, 2000)
49+
4350
const stopUserPolling = router.poll(
4451
1000,
4552
{
@@ -81,6 +88,9 @@ onMounted(() => {
8188
<div>{{ company }}</div>
8289
</div>
8390
</div>
91+
<div>
92+
<div class="mb-2 font-bold">Hook Count: {{ hookPollCount }}</div>
93+
</div>
8494
<div>
8595
<button @click="trigegerAsyncRedirect">Trigger Async Redirect</button>
8696
</div>

0 commit comments

Comments
 (0)