Socket
Socket
Sign inDemoInstall

is-observable

Package Overview
Dependencies
1
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    is-observable

Check if a value is an Observable


Version published
Maintainers
1
Install size
14.6 kB
Created

Package description

What is is-observable?

The is-observable package is used to check if a value is an RxJS Observable. RxJS Observables are a core part of reactive programming, which involves working with asynchronous data streams. This package provides a simple utility function to determine if a given object conforms to the Observable contract.

What are is-observable's main functionalities?

Check if a value is an Observable

This feature allows developers to verify if a particular value is an RxJS Observable. This is useful in scenarios where type checking is necessary before performing operations on the value assumed to be an Observable.

const isObservable = require('is-observable');
const { Observable } = require('rxjs');

const obs = new Observable(subscriber => {
  subscriber.next('Hello World');
  subscriber.complete();
});

console.log(isObservable(obs)); // true
console.log(isObservable({})); // false

Other packages similar to is-observable

Readme

Source

is-observable Build Status

Check if a value is an Observable

Install

$ npm install is-observable

Usage

const isObservable = require('is-observable');

isObservable(Observable.of(1, 2));
//=> true

License

MIT © Sindre Sorhus

Keywords

FAQs

Last updated on 07 Dec 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc