-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
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
How realtime works? #57
Comments
There was some issues getting the RealTimeSaga working, I don't have time to look in to it now, but you can have a look and see if you can get it working if you want 👍 |
@benwinding Thanks for your reply. I just know the |
@zhouhao27 as you mentioned React Admin v3 removed the |
ra-realtime is only available in the premium version of react-admin, closing, will open again if needed |
hi @benwinding, is there no way to use the ra-realtime module with this library at all? we really need this feature but are currently using the latest versions (v3.x of both ra and raf) |
@kiptoomm are you an react-admin enterprise customer then? Apparently they redesigned the entire ra-realtime module, and I'm not sure it's even open-source anymore, this is why it hasn't realtime support hasn't been implemented in this library. |
@benwinding no we're not on the premium version (looks good but not yet attainable for our fledgling business 😅). I have followed the thread in marmelab/react-admin#5547 and now see why you're not sure if Well, do you have any suggestions on how we can still use RAF and achieve some kind of real-time effects? To be more precise, here is our need:
What we want is for the change in the backend to propagate automatically to the frontend. I saw that Firebase supports listening for realtime updates, but they seem to require us to attach the onSnapshot() listeners to queries. Since we use the RAF data provider, we don't use the explicit queries indicated on the Firebase realtime docs. Do you have any suggestions on how we can implement our use case with RAF? |
Hi @kiptoomm,
Try something like this (this hasn't been tested): // On a <List /> view
import { useRefresh } from "react-admin";
import firebase from 'firebase/app';
import * as firebase from "firebase/app";
const refresh = useRefresh();
// Watch collection
firebase.firestore().collection('my-collection').onSnapshot(a => {
console.log('my-collection changed!');
// This refreshes the list view
refresh();
}) Let me know how it goes, |
Hi @benwinding, pardon my delay - I have just gotten back to this task and applied your solution. It worked like a charm 😁 🙇♂️ |
I'm wondering how realtime works. For example, I have a data collection call
news
. How to monitor it and get notified if there is a new update.The text was updated successfully, but these errors were encountered: