invokeLater
A helper function to invoke a block of code on the next event loop.
This can be useful if you want to ensure an action gets delayed until the DOM has a chance to process all pending requests. This can occasionally be important to ensure an action happens AFTER the current page recomposition finishes, for example.
This is equivalent to window.setTimeout(block, 0)
but with a parameter order that takes advantage of Kotlin's lambda syntax.
Return
A CancellableActionHandle to the action being invoked. Use CancellableActionHandle.cancel to cancel the action.