If use Interface(not actual) have to think about dependency injection
JavaScript is dynamic, and we can't type declaration.
interface Focusable {
focus(){}
}
Class Focus {
// js is dynamic so argument name is important to express dependency injection
focuTo(focusable){
focusable.focus()
}
}
If use Interface(not actual) have to think about dependency injection
JavaScript is dynamic, and we can't type declaration.