Realtime feature
See original GitHub issueJust trying to use basic realtime features within a Vue component like so:
<script lang="ts" setup>
import type { WorkEvent } from '~/types/event';
const supabase = useSupabaseClient();
const props = defineProps<{ event: WorkEvent; }>();
const { data: count } = await useAsyncData('votes-count', async () => {
const { count } = await supabase.from('user-votes').select('*', { count: 'exact' }).eq('event', props.event.id);
return count;
});
supabase.from('user-votes').on('*', () => {
refreshNuxtData('votes-count');
}).subscribe();
</script>
<template>
<NuxtLink
:to="`/dashboard/events/${props.event.id}`"
>
<div class="card card-compact w-full bg-base-100">
<div class="card-body">
<h2 class="card-title line-clamp-1">
{{ props.event.name }}
</h2>
<p class="line-clamp-3">
{{ props.event.description }}
</p>
<div class="card-actions">
<div class="badge">
{{ count }} votes
</div>
</div>
</div>
</div>
</NuxtLink>
</template>
But this does not work and throws a Cannot read properties of undefined (reading 'event')
error the moment I try to use the subscribe feature.
Is there a way to get those feature working or is this out of the scope of this module for now?
Issue Analytics
- State:
- Created a year ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Real-Time Feature Engineering with a Feature store
So let's talk about the difference between real-time and batch feature stores… Batch: Slow, suitable for training processes that can take hours.
Read more >Near real-time features for near real-time personalization
The near-real time features can capture the short-term intent and preferences of a member, while the other features can capture the ...
Read more >Feature Stores for Real-time AI & Machine Learning
The feature store is used for real-time use cases as Recommendations, Churn & Premium Predictions, Ranking and Spam Classifier, and is ...
Read more >Building Real-Time ML Pipelines with a Feature Store - Medium
First, let's review the difference between real-time and batch feature stores… Batch: Slow, suitable for training processes that can take hours.
Read more >Building Riviera: A Declarative Real-Time Feature ...
Real-time features enable DoorDash's models to be more predictive, the challenge is making them easier to configure.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Try wrapping the subscription inside an
onMounted
hook:Also make sure to unsubscribe on unmount:
And make sure you have turned on the Real Time API for your table.
Indeed ! Thanks !