Nothing 😜
For further actions, you may consider blocking this person and/or reporting abuse
Nothing 😜
For further actions, you may consider blocking this person and/or reporting abuse
Use any Linode offering to create something unique or silly in the DEV x Linode Hackathon 2022 and win the Wacky Wildcard category
→ Join the Hackathon <-
Connie Leung -
Chetanam -
Saurabh Dashora -
Gus Pear 🍐 -
Once suspended, macsikora will not be able to comment or publish posts until their suspension is removed.
Once unsuspended, macsikora will be able to comment and publish posts again.
Once unpublished, all posts by macsikora will become hidden and only accessible to themselves.
If macsikora is not suspended, they can still re-publish their posts from their dashboard.
Once unpublished, this post will become invisible to the public and only accessible to Pragmatic Maciej.
They can still re-publish the post if they are not suspended.
Thanks for keeping DEV Community 👩💻👨💻 safe. Here is what you can do to flag macsikora:
Unflagging macsikora will restore default visibility to their posts.
Top comments (3)
Disclaimer: all written below is just my opinion.
Optional chaining is an attempt to provide a imperative replacement for single method (
map()
) of single Monad (Maybe
). The attempt is quite clunky, it makes code less verbose but harder to read, compose and refactor.I've not used optional chaining in TypeScript, my opinion is based on using it in Kotlin.
Hi Sergiy,
thank you for the comment.
The thing is that optional chaining in really only syntax sugar on doing ifs, and in particular -
if (x!== null && x!==undefined)
. The fact that you can chain object property getters (dots) can be viewed as more chain,flatMap, where every getter gives youx | undefined
and the next getter works onx
. But its not a Monad as it has nomap
, and you really cannot use any function in this chain outside of mentioned property getters. So in reality it can give you partially what Maybe can give, but in very limited scope, and the basement is not on any monadic abstractions, but standard ifing.That is exactly my point - optional chaining is a imperative construct attempting to replace functional style in some quite narrow scope.