# @fp-tools/rxjs

> Additional operators for RxJs that makes your code more readable

Latest version **1.0.0** (published 2022-09-26) · 0 weekly downloads

## Install

```sh
npm install @fp-tools/rxjs
pnpm add @fp-tools/rxjs
yarn add @fp-tools/rxjs
bun add @fp-tools/rxjs
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2022-09-26 |
| First published | 2022-09-26 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 15 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | bo_firepeak |

## Links

- npm: https://www.npmjs.com/package/@fp-tools/rxjs
- npm.io page: https://npm.io/package/@fp-tools/rxjs

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^2.3.0

## Recent versions

- 1.0.0 (latest) — 2022-09-26

## README

# RxJs utils

Additional operators for RxJs that makes your code more readable
 
# HowTo use the library
To install
`npm i @fp-tools/rxjs` or `yarn add @fp-tools/rxjs`

## Filter operators

Filter values that are not null
```typescript
import {isNotNullOrUndefined} from '@fp-tools/rxjs';

of([null, 'abc', false]).pipe(
      isNotNullOrUndefined()
).subscribe(value => console.log(value));

// ['abc', false]
```

Filter values that are null

```typescript
import {isNullOrUndefined} from '@fp-tools/rxjs';

of([null, 'abc', false]).pipe(
      isNotNullOrUndefined()
).subscribe(value => console.log(value));

// [null]
```

## Transform operators
If a value is null or undefined, a default value will be returned.

```typescript
import {valueOrDefault} from '@fp-tools/rxjs';

of([null, 'abc', false]).pipe(
    valueOrDefault('abc')
).subscribe(value => console.log(value));

// ['abc', 'abc', false]
```

If a value is null or undefined, a default value will be returned, otherwise the value will be transformed.

```typescript
import {valueOrDefault} from '@fp-tools/rxjs';

of([null, 0, 1, 4]).pipe(
  valueOrDefault('abc', value => value * 2)
).subscribe(value => console.log(value));

// ['abc', 0, 2, 8]
```

# License
MIT © Bo Vandersteene

---
_Source: https://npm.io/package/@fp-tools/rxjs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
