What is the "hook" that is always mentioned when you look at the official documents of some languages?

Front-end rookie, when writing code, I often need to see the document. API, encountered the word hook again when I went to see the Webpack document today. I found that this noun is often mentioned, in addition, hook function , injection hook , and so on, what are you actually talking about hook? A rookie, please give me some advice.

Oct.30,2021
The

hook is actually a function, and when you write the corresponding function, the framework will call your function under specific circumstances, such as startup, update, completion, etc.


In computer programming, the term hooking covers a range of techniques used to alter or augment the behavior of an operating system, of applications, or of other software components by intercepting function calls or messages or events passed between software components. Code that handles such intercepted function calls, events or messages is called a hook.
Wikipedia

Menu