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
The way the useEffect for the src/components/Account/Account.jsx component is implemented is triggering the getAccount query multiple times ( not necessary on my opinion ) because it is defined to be executed every time the component gets updated ( no dependency set on the array parameter ). While the query is running and returning its corresponding state, the query is called again and again until it gets stopped.
If the purpose of the component is to work as a subscription listening to new events i would:
Switch to useQuery and rely on polling parameter to determine a reading interval . ( There is no need for the useEffect since the process will be launched automatically every X time ).
May be use a web socket instead of a query and subscribe accordingly so component gets updated when a new event happen WebSocket-Node
The text was updated successfully, but these errors were encountered:
The way the useEffect for the
src/components/Account/Account.jsx
component is implemented is triggering thegetAccount
query multiple times ( not necessary on my opinion ) because it is defined to be executed every time the component gets updated ( no dependency set on the array parameter ). While the query is running and returning its corresponding state, the query is called again and again until it gets stopped.If the purpose of the component is to work as a subscription listening to new events i would:
Switch to useQuery and rely on polling parameter to determine a reading interval . ( There is no need for the useEffect since the process will be launched automatically every X time ).
May be use a web socket instead of a query and subscribe accordingly so component gets updated when a new event happen WebSocket-Node
The text was updated successfully, but these errors were encountered: