1.0.0 • Published 4 years ago

inline-if v1.0.0

Weekly downloads
1
License
ISC
Repository
github
Last release
4 years ago

Inline-If

Inline If is a programming method to make a condition in a line.

Installation

Use the package manager node.js to install inline-if.

npm install inline-if

or if you use yarn

yarn add inline-if

Usage

Usually js inline condition

render(){
   return condition ? <Text>Condition if true</Text> : <Text>Condition if else</Text>
}

change it to

import iif from "inline-if"

render(){
   iif(condition)(
      <Text>Condition if true</Text>
   )(
      <Text>Condition if else</Text>
   )
}

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.