D
D
dodgerprof2021-06-25 08:48:16
JavaScript
dodgerprof, 2021-06-25 08:48:16

[Style Guide] When should you add on- or handle-?

I have no problems with the naming of functions, it is quite simple here.

Functions starting with…
"get…" return a value,
"calc…" compute something,
"create…" create something,
"check…" check something and return a boolean value, etc. d.


But in what cases should you add the on- or handle- prefix?
Are prefixes needed? It was not possible to find information about this

Now I call it that.
Let's assume that the method generates a contacts object, then I'll call it - formatObjectContacts.
If it does something else before formatting the object, then onFormatObjectContacts.

Am I going the right way? Tell us what rules you use or poke your nose into some article about this

(Learning Vue.js)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question