---
url: "https://vueda.dev/v3/reference/api/js/utils/dev/functions/watchIfDev.md"
title: "watchIfDev"
---

# watchIfDev

## Overview

Call `watch` only when running in development mode; returns a no-op stop handle in production.

## Signature

`watchIfDev(source, cb, options)`

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| <span id="param-source">source</span> | `WatchSource \| WatchSource[]` | yes | The reactive source(s) to watch. |
| <span id="param-cb">cb</span> | `WatchCallback` | yes | Callback invoked when the source changes. |
| <span id="param-options">options</span> | `WatchOptions` | no | Options forwarded to `watch`. |

### Returns

`WatchStopHandle`

A function that stops the watcher (or a no-op in production).

## Source

`client/lib/utils/dev.js:15`
