Skip to content

sms-system/conditional-chain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

conditional-chain

Bring some logic to js waterfalls

Before:

let num = Math.pow(2, 10)
if (isEngineeringMode) num = num.toExponential()
if (toUpper) num = num.toUpperCase()
return num

After:

const num = cond(Math.pow(2, 10))
  .if(isEngineeringMode, num => num.toExponential())
  .if(toUpper, num => num.toUpperCase())
  .end()

return num

About

Bring some logic to js waterfalls

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published