Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaly-t committed Aug 5, 2019
1 parent b248e6a commit 27d9e11
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
13 changes: 3 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Build Status](https://travis-ci.org/vitaly-t/sub-events.svg?branch=master)](https://travis-ci.org/vitaly-t/sub-events)
[![Coverage Status](https://coveralls.io/repos/vitaly-t/sub-events/badge.svg?branch=master)](https://coveralls.io/r/vitaly-t/sub-events?branch=master)

Strongly-typed generic events in TypeScript.
Strongly-typed events in TypeScript, with monitored subscriptions.

Supports all versions of Node.js and browsers.

Expand Down Expand Up @@ -43,7 +43,7 @@ sub.cancel();

**API:** [Subscription], [subscribe], [cancel]

### Observing Subscriptions
### Monitoring Subscriptions

Class [SubEventCount] extends [SubEvent] with event [onCount], to observe the number of live subscriptions:

Expand All @@ -52,18 +52,11 @@ import {SubEventCount, ISubCountChange} from 'sub-events';

// creating a strongly-typed event:
const e: SubEventCount<string> = new SubEventCount();
```

Monitor the number of subscriptions:

```ts
const monSub = e.onCount.subscribe((info: ISubCountChange) => {
e.onCount.subscribe((info: ISubCountChange) => {
// number of subscriptions has changed;
// info = {newCount, prevCount}
});

// cancel monitoring when no longer needed:
monSub.cancel();
```

**API:** [SubEventCount], [onCount]
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "sub-events",
"version": "0.5.3",
"description": "Strongly-typed generic events in TypeScript.",
"version": "0.5.4",
"description": "Strongly-typed events in TypeScript, with monitored subscriptions.",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
"homepage": "https://github.com/vitaly-t/sub-events",
Expand Down Expand Up @@ -36,10 +36,10 @@
"keywords": [
"event",
"strongly-typed",
"generic",
"count",
"monitoring",
"subscription",
"typescript",
"count"
"typescript"
],
"devDependencies": {
"@types/chai": "4.1.7",
Expand Down

0 comments on commit 27d9e11

Please sign in to comment.