5 ms·
Dunno, but I hope not. We built a moderate-sized TS codebase with _no objects at all_. Just functions and data types. Roughly functional ... with the caveat tha
by charlieflowers 10y ago
Dunno, but I hope not. We built a moderate-sized TS codebase with _no objects at all_. Just functions and data types. Roughly functional ... with the caveat that nothing was preventing us from mutating incoming params (though our intent was not to do so).
I'd like to hope many people are using TS in a functional style.
EDIT -- there was one object ... we had to create an exception class for some reason ... don't fully recall the details.
- robpalmer 10y agoA codebase with no objects... I am guessing you mean no classes.
- Stoids 10y agoSeeing how functions are objects in JavaScript and all...
- charlieflowers 10y ago:rollseyes:
- crooked-v 10y agoIt's a bit wordy, but I think you can do something like: function test ({param1, param2}: {readonly param1: string, readonly param2: number}) { return }