doOnDetach
Performs the given action when this view is detached from a window. If the view is not attached to a window the action will be performed immediately, otherwise the action will be performed after the view is detached from its current window.
The action will only be invoked once, and any listeners will then be removed.