publish: add callbacks directly on object

generated from commit 11ac4d439cde82c6567b91146d60335354d5a69d