How to detect when the user clicks the publish/update button in Gutenberg Editor

I think it’s late for the party but there is an action is core/editor package of block editor called isSavingPost. Haven’t used it but I think it’s worth giving a try.

https://developer.wordpress.org/block-editor/reference-guides/data/data-core-editor/#issavingpost

tech