Test whether an object is a Reactive Streams component
Platform | Build Status |
---|---|
Linux | |
Windows |
npm i is-reactive-streams
- 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>
import { isPublisher, isSubscriber, isSubscription, isProcessor } from 'is-reactive-streams';
const { isPublisher, isSubscriber, isSubscription, isProcessor } = require('is-reactive-streams');
A global variable declared as 'IRS' provides the 4 functions.
const { isPublisher, isSubscriber, isSubscription, isProcessor } = IRS;
- IRS :
object
- isPublisher(publisher) ⇒
boolean
Test whether an object implements the Publisher interface.
- isSubscriber(subscriber) ⇒
boolean
Test whether an object implements the Subscriber interface.
- isSubscription(subscription) ⇒
boolean
Test whether an object implements the Subscription interface.
- isProcessor(processor) ⇒
boolean
Test whether an object implements the Processor interface.
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. |
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. |
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. |
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. |
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