4 ms·
If you're too impatient to wait for first-class optional chaining in TS, there's a nice open-source library for it that's been around for a little while: Repo:
by jdm2212 7y ago
If you're too impatient to wait for first-class optional chaining in TS, there's a nice open-source library for it that's been around for a little while:
Repo: https://github.com/rimeto/ts-optchain https://github.com/rimeto/ts-optchain
Blog post with some details: https://medium.com/inside-rimeto/optional-chaining-in-typescript-622c3121f99b https://medium.com/inside-rimeto/optional-chaining-in-typesc...
(I don't work for Rimeto, but a close friend did, which is how I stumbled on that blog post.)
- Shakahs 7y agoHadn't seen this before, but I've been using a library from Facebook called idx: https://github.com/facebookincubator/idx https://github.com/facebookincubator/idx Idx is a bit more verbose because you have to write an arrow function for each invocation, and it doesn't support default values.