# useEffectWithPolling

This is similar to useEffect hook in react. This is more like a advanced version of react useEffect. Here callback function get executed not only when the dependencies changes, but in regular intervals. Also you can push a message through message bus to trigger the callback

## Installation

```tsx
import { useEffectWithPolling } from 'uxp/components';
```

## Signature

```tsx
function useEffectWithPolling(context: any, channel: string, interval: number, callback: () => Promise<void>, deps: any[]): IUseEffectWithPolling
```

## Examples

```tsx
useEffectWithPolling(props.uxpContext, "visitor-arrivals", 5000, getVisitors, [props])
```

## Related Types

* [IUseEffectWithPolling](https://help.iviva.com/uxp/v5/additional-resources/types/iuseeffectwithpolling)
