3 ms·
Because this is an internal function in a _library_, and you should be willing to look inside it if you're changing a call to it. Here's where whether or not i
by benatkin 2y ago
Because this is an internal function in a _library_, and you should be willing to look inside it if you're changing a call to it.
Here's where whether or not it's defined can be traced to: https://github.com/hotwired/turbo/blob/41c074ff113a8882aadbc2758b76860efbcfbf01/src/observers/form_submit_observer.js#L30 https://github.com/hotwired/turbo/blob/41c074ff113a8882aadbc...
Maybe the types should have been written differently, to indicate that it's the type of the submitter property in a FormEvent. That's another cost of using TypeScript, is trying to get the types right. TMTOWTDI.
- seanwilson 2y ago> Because this is an internal function in a _library_ Why does that matter? Error-prone approaches create buggy code and we don't want buggy code, whether it's a library or something else. Libraries can be huge and complex, and arguably should have more robust edge case checking than regular code.