conditionally-execute
Lets you abandon "if" keyword
Install
Install with npm:
npm install bopke/conditionaly-execute
Usage
const ConditionallyExecute = ;
It's extremely easy to start using conditionally-execute, with its simple, straightforward and intelligible design.
Just take a look on that piece of code:
{ console;}{ console;} ;
The above code will, obviously, print out "True!".
It doesn't matter how we order method calls, as long as execute() method is the last one of our chain. Method calls from the above example can be as well ordered like this:
;
Usage with existing code
Obviously, this library does not collide with any existing if
statements. It's also ultra-easy to refactor your existing code to make it make a good use of conditionally-execute. Just look on that example:
old, ugly iffed code:
ifcondition console;else console;
new, beautiful conditionally-executed code:
;