many thanks. I've read about "Dependency inversion principle" and I know it clearly after reading your article.
Even though JS doesn't have interface, this is a good, clear and simple example.
in JS files, I usually use export and import some functions into a module, so is it the way could replace DI?
many thanks. I've read about
"Dependency inversion principle"
and I know it clearly after reading your article.Even though JS doesn't have interface, this is a good, clear and simple example.
in JS files, I usually use
export and import
some functions into a module, so is it the way could replace DI?Yes, you dont really need to create class objects to use funtions in js. You can directly use functions in most of the case. Glad you liked it.