is-reactive-streams
v1.0.0
Published
Test whether an object is a Reactive Streams component
Downloads
11
Readme
is-reactive-streams
Test whether an object is a Reactive Streams component
| Platform | Build Status | | --- | --- | | Linux | | | Windows | |
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
| Param | Type | Description | | --- | --- | --- | | publisher | object | An object that is expected to implement the Publisher interface. |
isSubscriber(subscriber) ⇒ boolean
Test whether an object implements the Subscriber interface.
Kind: global function
| Param | Type | Description | | --- | --- | --- | | subscriber | object | An object that is expected to implement the Subscriber interface. |
isSubscription(subscription) ⇒ boolean
Test whether an object implements the Subscription interface.
Kind: global function
| Param | Type | Description | | --- | --- | --- | | subscription | object | An object that is expected to implement the Subscription interface. |
isProcessor(processor) ⇒ boolean
Test whether an object implements the Processor interface.
Kind: global function
| Param | Type | Description | | --- | --- | --- | | processor | object | An 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