Skip to content

RTK Query, Streaming updates, Initial http request needed? #1615

Answered by phryneas
ThoMot asked this question in Q&A
Discussion options

You must be logged in to vote

Is it a common pattern to always fetch the initial data structure via a request before connecting to a websocket?

Often ppl only want to receive updates via websocket and the initial value from the server, yes. So we showed the "most complex" scenario of mixing both.

Is this possible to avoid by providing this structure locally instead?

Yes, you can find an example of that here: https://github.com/phryneas/cli-mqtt-chatclient/blob/main/src/api.ts

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by ThoMot
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants