---
title: "onStateUpdate(_:)"
framework: network
role: symbol
role_heading: Instance Method
path: "network/networkbrowser/onstateupdate(_:)"
---

# onStateUpdate(_:)

Set a closure to be called when the browser’s state changes.

## Declaration

```swift
@discardableResult final func onStateUpdate(_ handler: @escaping @isolated(any) @Sendable (NetworkBrowser<Provider>, NetworkBrowser<Provider>.State) -> Void) -> Self
```

## Discussion

Discussion The closure may be called multiple times until the browser is cancelled. The closure inherits the isolation domain of the caller.
