is-reactive-streams

1.0.0 • Public • Published

is-reactive-streams

Test whether an object is a Reactive Streams component

NPM

HitCount

Platform Build Status
Linux Build Status
Windows Build 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

IRS : object

Functions

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.

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    4
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    4
  • 0.1.0
    0

Package Sidebar

Install

npm i is-reactive-streams

Weekly Downloads

4

Version

1.0.0

License

MIT

Unpacked Size

14.3 kB

Total Files

6

Last publish

Collaborators

  • lxsmnsyc