Add is.observable (#50)

This commit is contained in:
Sam Verschueren 2018-05-03 05:22:32 +02:00 committed by Sindre Sorhus
parent 38df0cfb24
commit 55c00956f9
5 changed files with 37 additions and 3 deletions

View file

@ -261,6 +261,16 @@ is.nodeStream(fs.createReadStream('unicorn.png'));
//=> true
```
##### .observable(value)
Returns `true` if `value` is an `Observable`.
```js
const {Observable} = require('rxjs');
is.observable(new Observable());
//=> true
```
##### .infinite(value)
Check if `value` is `Infinity` or `-Infinity`.
@ -281,7 +291,6 @@ Returns `true` if `value` is falsy or an empty string, array, object, map, or se
Returns `true` if `is.empty(value)` or a string that is all whitespace.
##### .any(predicate, ...values)
Returns `true` if **any** of the input `values` returns true in the `predicate`:
@ -306,6 +315,7 @@ is.all(is.string, '🦄', [], 'unicorns');
//=> false
```
## FAQ
### Why yet another type checking module?