1.0.0 • Published 9 years ago
switch-exp v1.0.0
Switch expressions
Switch as an expression in Javascript, inspired by @FGRibreau's https://github.com/FGRibreau/if-exp.
Install
npm install switch-exp
## Usage
import _switch from 'switch-exp';
const a = _switch( thing )
.case( condition1 )
.then( 'value1' )
.case( condition2 )
.then( 'value2' )
.default( 'defaultValue' );
1.0.0
9 years ago