Skip to content

nicolasbrugneaux/switch-exp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Switch expressions Build Status

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' );

About

Switch as expressions for JavaScript

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published