# flow-if-else-component

> If-else logic using Flow SDK.

Latest version **0.2.5** (published 2019-06-08) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install flow-if-else-component
pnpm add flow-if-else-component
yarn add flow-if-else-component
bun add flow-if-else-component
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.5 |
| Published | 2019-06-08 |
| First published | 2018-11-05 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 19.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Hackerbay Inc. |
| Maintainers | hackerbayadmin |
| Keywords | if, else, flow |

## Links

- npm: https://www.npmjs.com/package/flow-if-else-component
- Repository: https://github.com/FlowAppPlatform/flow-if-else-component
- Homepage: https://github.com/FlowAppPlatform/flow-if-else-component#readme
- Issues: https://github.com/FlowAppPlatform/flow-if-else-component/issues
- npm.io page: https://npm.io/package/flow-if-else-component

## Dependencies (1)

- [flow-platform-sdk](https://npm.io/package/flow-platform-sdk.md) ^1.3.1

## Alternatives

- [update-check](https://npm.io/package/update-check.md) — 4.0M weekly downloads
- [react-native-onesignal](https://npm.io/package/react-native-onesignal.md) — 134.5K weekly downloads
- [react-redux-toastr](https://npm.io/package/react-redux-toastr.md) — 33.7K weekly downloads
- [@nocobase/plugin-notification-manager](https://npm.io/package/@nocobase/plugin-notification-manager.md) — 2.0K weekly downloads
- [react-simple-toasts](https://npm.io/package/react-simple-toasts.md) — 1.9K weekly downloads

## Recent versions

- 0.2.5 (latest) — 2019-06-08
- 0.2.3 — 2019-03-10
- 0.2.1 — 2019-02-15
- 0.1.9 — 2018-12-26
- 1.0.0 — 2018-11-05

## README

# Flow if-else component
The component evaluates an expression to true or false.

*To use the component, in your NodeJS project, get it from npm registry*

```
npm i flow-if-else-component --save
```

*Use the component as below*

```javascript
// require the component
const Component = require('flow-if-else-component');

// create instance of the component
const component = new Component();
```

*Provide the expression*

```javascript
// this can be any javascript expression, '[].length', 'a==1', ' ' and more
component.getProperty('Expression').data = 'q=1'; 
```

*That's all, now listen in for port emit events*
```javascript
component.getPort('True').onEmit(function() {
  // the expression evaluated to true
});

component.getPort('False').onEmit(function() {
  // the expression evaluated to false
});
```

*Execute the component*
```javascript
// add the component to a graph before executing it
const Graph = require('flow-platform-sdk').Graph;
new Graph("graph-1").addComponent(component);

component.execute();
```

#### Conclusion

That's all required to use Flow's If-else component.

---
_Source: https://npm.io/package/flow-if-else-component · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
