• Core
  • Actions
  • watchNetwork

watchNetwork

Action for subscribing to network changes.

import { watchNetwork } from '@wagmi/core'

Usage

By default, the callback will be invoked when network changes.

import { watchNetwork } from '@wagmi/core'
 
const unwatch = watchNetwork((network) => console.log(network))