React-admin: [FEATURE REQUEST] use websocket

Created on 2 Apr 2017  路  4Comments  路  Source: marmelab/react-admin

I know that this project requires a rest client, but using websocket is very useful in some situations.
Can you consider also use websocket?

Most helpful comment

You already can. Just supply your own client. If you want real time updates, you should provide a custom saga too. Take a look at the Apollo client for inspiration

All 4 comments

You already can. Just supply your own client. If you want real time updates, you should provide a custom saga too. Take a look at the Apollo client for inspiration

@djhi We would also like to have a "refresh" of data when something new is added to the server's data (from a mobile app for example). Since we already use a dataProvider (customized), we are not sure what we should change there to do this with websockets (without websockets we would have to unwisely poll every 5 seconds).

Would you care (or have the time) to explain this in a blog post maybe? Not the entire solution obviously, just a sample of changes to be made to the data provider and to the sagas would be great!

I believe that having some steps to refresh the List data based on "pushed" changes will enhance greatly the react-admin platform for many developers, not just us.

Thanks!

For the record, react-admin contains a realtime package, ra-realitime.

Following up on this, when working with several people in different browsers on the same table it's essential to receive updates on the changes other teammates make.

For example, an order that was approved should be updated on every browser that's open on that table, so people can be productive at their jobs.

The link on top is broken, I did find the repo, but it seems it's outdated and for the old version/name of React-Admin. I also checked the Apollo Client, but could not get too far.

Making a component that sits at root of the app and receives WebSocket messages it's simple enough, what I think could be improved is a simplified way ( or documented example ) of how to update the Redux store for the data on the current DataGrid being displayed. Sounds simple enough if you know the inner wirings of the redux stores.

Was this page helpful?
0 / 5 - 0 ratings