Let's say I have a `checkStatus()` method which is triggered after a response to an endpoint is successful. Inside this there is a `setInterval` like so:

```
checkStatus() {
    setInterval(() => {
      client
        .query({
          query,
          variables,
        })
        .then(res => {
          if (res.status) {
            console.log("FINISHED!");
          }
        });
    }, 3000);
}

```

Basically I am querying an endpoint every 3 seconds. Once the `res.status` becomes `true`, I want to clear the interval. The component is still there and hasn't unmounted yet.

How do I achieve this?