What is method argument for?

When you define an function to be used in a hook, you put 2 arguments (doc, method). What is the 2nd argument used for?I have never had to use it and could not find an example

Hi, Its the method that trigger the function, ie. you can call same method from different events and know what the event is. method is a string eg: “on_update”, “on_submit” etc.