Functional Programming Approach to Methods in TypeScript
Hi, have a question regarding functional programming in TS as a whole.
So I have usually created classes, and put methods inside of them to make intellisense easy.
For example,
I would call the methods on the class. However, I do not believe this is very idiomatic, especially in the FP realm.
How would most people do this?
Just defining it as an interface, and exporting functions from the same file?
Wouldn't the codebase then be littered with functions of the same name, such as
So I have usually created classes, and put methods inside of them to make intellisense easy.
For example,
I would call the methods on the class. However, I do not believe this is very idiomatic, especially in the FP realm.
How would most people do this?
Just defining it as an interface, and exporting functions from the same file?
Wouldn't the codebase then be littered with functions of the same name, such as
toString() ?