Executes a callback function and waits for network requests to settle before returning.This function monitors network activity and waits for all pending requests to complete
(or reach the specified maximum) before resolving. Useful for ensuring dynamic content
has fully loaded after performing actions that trigger network requests.
import { withNetworkSettledWait } from "@intuned/browser";export default async function handler(params, page, context){// Navigate and ensure all resources are loadedawait withNetworkSettledWait( async (page) => { await page.goto('https://spa-app.com/dashboard'); // Return when navigation is complete and network is idle }, { page, timeoutInMs: 20000, maxInflightRequests: 0 // Wait for complete network silence });}