Register a function to a hook with the specified name.
The registered function is called at appropriate timings by the core code.
Arguments passed to the function depend on the hook.
When multiple functions are registered, they are called by the order in which
they are registered.
Parameters
name: string
Name of the hook.
fn: (...p1:any[])=>any
Function to be registered to the hook.
OptionalatFirst: boolean
If true, the function is registered at the first of the hook array.
Register a function to a hook with the specified name. The registered function is called at appropriate timings by the core code. Arguments passed to the function depend on the hook. When multiple functions are registered, they are called by the order in which they are registered.