We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Would be handy to see how this works in an each loop in the examples
The text was updated successfully, but these errors were encountered:
@mattpilott I did something like this
<script> import { onMount } from "svelte" import IntersectionObserver from 'svelte-intersection-observer' let notifications = [] let notificationsDom = [] onMount(() => { setInterval(loadNotifications, 30000); loadNotifications() }) async function loadNotifications() { const response = await fetch('/api/notifications') notifications = (await response.json()) notificationsDom = new Array(notifications.length) } async function markReadNotificationId(id) { console.log(id) } </script> <div class="list-group list-group-flush list-group-activity my-n3"> {#each notifications as notification, i} <IntersectionObserver element={notificationsDom[i]} on:intersect={() => { markReadNotificationId(notification.id) }}> <a class="list-group-item text-reset" bind:this={notificationsDom[i]} href="{notification.link}"> ... </a> </IntersectionObserver> {/each} </div>
Sorry, something went wrong.
No branches or pull requests
Would be handy to see how this works in an each loop in the examples
The text was updated successfully, but these errors were encountered: