Update already received data by an event? #450
BigBadAlien
started this conversation in
Ideas
Replies: 1 comment
-
Probably you mean subscriptions? It was recently added. There is no tutorial for it yet, just API description. But there is graphql example, you can start here: https://github.com/klis87/redux-requests/blob/master/examples/graphql/src/store/actions.js#L141 But this library supports any websocket connection as subscriptions, not just graphql. Current sources of information:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What if we need not only to load data once but update it on an event?
e.g. We loaded two balances, there are USD and HKD by HTTP (let's say FETCH_BALANCE action), connected to the socket, and received a notification that the USD balance updated. We need to update the balance and leave HKD as is (So, update data partially)
I wrote an additional reducer to support like
FETCH_BALANCE_UPDATE
action and modify the request data. It's not really reliable since the structure of the requested data is not public API and can be changed at any time.I think it's a pretty common situation, and would be nice to have stable approaches in API. Or any ideas on how to resolve it better?
Beta Was this translation helpful? Give feedback.
All reactions