Is there a way to create interfaces in ES6 / Node 4?

后端 未结 6 1636
[愿得一人]
[愿得一人] 2021-01-30 08:13

ES6 is fully available in Node 4. I was wondering whether it includes a concept of interface to define method contracts as in MyClass implements MyInterface.

6条回答
  •  梦如初夏
    2021-01-30 08:20

    Flow allows interface specification, without having to convert your whole code base to TypeScript.

    Interfaces are a way of breaking dependencies, while stepping cautiously within existing code.

提交回复
热议问题