1.0.0 • Published 5 years ago

is-reactive-streams v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

is-reactive-streams

Test whether an object is a Reactive Streams component

NPM

npm.io HitCount

PlatformBuild Status
LinuxBuild Status
WindowsBuild status

codecov Known Vulnerabilities

Usage

Installing

NPM

npm i is-reactive-streams

CDN

  • jsDelivr
<script src="https://cdn.jsdelivr.net/npm/is-reactive-streams/dist/index.min.js"></script>
  • unpkg
<script src="https://unpkg.com/is-reactive-streams/dist/index.min.js"></script>

Loading the Module

ESNext

import { isPublisher, isSubscriber, isSubscription, isProcessor } from 'is-reactive-streams';

CommonJS

const { isPublisher, isSubscriber, isSubscription, isProcessor } = require('is-reactive-streams');

Browser

A global variable declared as 'IRS' provides the 4 functions.

const { isPublisher, isSubscriber, isSubscription, isProcessor } = IRS;

API

Objects

Functions

IRS : object

Kind: global namespace

isPublisher(publisher) ⇒ boolean

Test whether an object implements the Publisher interface.

Kind: global function

ParamTypeDescription
publisherobjectAn object that is expected to implement the Publisher interface.

isSubscriber(subscriber) ⇒ boolean

Test whether an object implements the Subscriber interface.

Kind: global function

ParamTypeDescription
subscriberobjectAn object that is expected to implement the Subscriber interface.

isSubscription(subscription) ⇒ boolean

Test whether an object implements the Subscription interface.

Kind: global function

ParamTypeDescription
subscriptionobjectAn object that is expected to implement the Subscription interface.

isProcessor(processor) ⇒ boolean

Test whether an object implements the Processor interface.

Kind: global function

ParamTypeDescription
processorobjectAn ojbect that is expected to implement the Processor interface.

Build

Clone the repo first, then run the following to install the dependencies

npm install

To build the coverages, run the test suite, the docs, and the distributable modules:

npm run build