Cover image by Dennis Skley on Flickr
Functional programming techniques seem to be rather popular these days. People are using monads in JavaScrip...
For further actions, you may consider blocking this person and/or reporting abuse
This is incredible. I have a lot of questions regarding how this is done. I use Ramda's
cond
quite a bit. But I really like this syntax.I'm curious to see how this works when minified. I believe it is using some type of reflection.
It seems to use a package called
js-function-reflector
which transforms a function object to it's string representation and parses it again.github.com/arrizalamin/js-function...
and
js-function-reflector
uses the toString() method availaible on functionsThat doesn't seem like it would work for minified code as the parameter names would be uglified.
It works as long as you don't compile the default arguments to ES5.
One limitation I see is something like this is not possible:
Very interesting, I would use it mostly to do validation. Looking forward to see what it becomes in the future.
Yes, I think the type-checking is the most practical feature of it, if it's exhaustive it could prevent many typical JavaScript bugs :)
Yeah, in functional languages it usually replaces conditionals but javascript has a plethora of them. This is super cool though.
Absolutely agree, I use Joi but it still seems not "natural enough" for me, always thought Javascript diserved something better. Here you go :)
Life's filling up with more and more z and z and... Good catch, did not know about this lib :)
Glad, you like it :)