DEV Community

Agik Setiawan
Agik Setiawan

Posted on


Use Side Effect with RTK Query Redux Tookit

How to detect side effect in RTK Query Redux Toolkit?
We can use React Hook sideEffect and put RTQ query into sideEffect for retrieve any changes.

Example call function from RTK Query:

const {data,isSuccess,isLoading,isError} = useGetUserQuery()
Enter fullscreen mode Exit fullscreen mode

and we can detect isSuccess,data,isloading with useEffect Hook


// detect isSuccess

// detect isLoading

// detect isError

Enter fullscreen mode Exit fullscreen mode

Top comments (0)

An Animated Guide to Node.js Event Loop

Node.js doesn’t stop from running other operations because of Libuv, a C++ library responsible for the event loop and asynchronously handling tasks such as network requests, DNS resolution, file system operations, data encryption, etc.

What happens under the hood when Node.js works on tasks such as database queries? We will explore it by following this piece of code step by step.