onBridgeDraining function

Module @runic-artifex/views in @runic-artifex/views 0.23.0

function onBridgeDraining(listener: (draining: boolean) => void): () => void;

The close drain (0.19, stable since 0.22): observes whether the application closed the current instance's window (the page's, outside RunicInstance.run) with a close drain. Calls listener with the current value at once, then after each change, until the returned function is called. true from the closing push with draining: true until the window's connection ends, when onBridgeConnection reports closed, or a new connection opens. Meanwhile the window stays visible, the connection stays connected and the page keeps receiving the window's state, so it can show that it is finishing, with the progress of its operations.