@cuties/if-else
Cutie extension for work with if-else statements.
Last updated a year ago by guseyn .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @cuties/if-else 
SYNC missed versions from official npm registry.

cutie-if-else

NPM Version Build Status codecov

Cutie extension for work with if-else statements. It's based on the Async Tree Pattern.

Examples

You can find examples of using this library in the test directory.

Install

npm install @cuties/if-else

Run test

npm test

Run build

npm run build

Usage

const {
  If, ElseIf, Else
} = require('@cuties/if-else');

new If(
 asyncTreeThatRepresentsBooleanStatement, asyncTreeThatIsBeingInvokedIfFirstArgumentIsTrue,   
 new ElseIf(
   anotherAsyncTreeThatRepresentsBooleanStatement, 
   anotherAsyncTreeThatIsBeingInvokedIfFirstArgumentIsTrue,
   new ElseIf(..., 
    new Else(otherwiseThisAsyncTreeIsBeingInvoked)
   )
 )
).call();
Async Object Parameters(description) Representation result
If statement, action, next(ElseIf or Else) boolean value of statement
IfNot statement, action, next(ElseIf or Else) boolean value of !statement
ElseIf statement, action, next(ElseIf or Else) boolean value of statement
Else action true
And ...statements statements.every(s => s)
Or ...statements statements.some(s => s)
Not ...statements statements.map(s => !s)

Current Tags

  • 1.1.2                                ...           latest (a year ago)

9 Versions

  • 1.1.2                                ...           a year ago
  • 1.1.1                                ...           a year ago
  • 1.1.0                                ...           2 years ago
  • 1.0.7                                ...           2 years ago
  • 1.0.6                                ...           2 years ago
  • 1.0.5                                ...           2 years ago
  • 1.0.4                                ...           2 years ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (4)
Dev Dependencies (6)

Copyright 2014 - 2016 © taobao.org |