You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.
It seems as if the use of store.getState() is absolutely fine in the RTK app for implementing the WebSocket logic in three static JS classes. However, if planning to make this compatible for an RTK + Next.js integration, it looks like the WebSocket logic needs to be implemented as middleware. There are generally a lot of alternatives that don't involve importing the store directly. The less the store is treated as a singleton, the easier the code becomes to test because the same logic can be called with any store instance rather than the single one exported from store.js.
This WebSocket logic needs to be implemented using middleware for better scalability with server-side rendered frameworks like Next.js.
See:
Keep it up,
The text was updated successfully, but these errors were encountered: