Skip to content

watchIfDev

Overview

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

Signature

watchIfDev(source, cb, options)

Parameters

NameTypeRequiredDescription
sourceWatchSource | WatchSource[]yesThe reactive source(s) to watch.
cbWatchCallbackyesCallback invoked when the source changes.
optionsWatchOptionsnoOptions forwarded to watch.

Returns

WatchStopHandle

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

Source

client/lib/utils/dev.js:15

Documents matching: server v3.0.0a1.post1client v3.0.0-alpha.2