Skip to content

Commit

Permalink
feat: 🎸 update to esmj/[email protected]
Browse files Browse the repository at this point in the history
BREAKING CHANGE: 🧨 Subscribe method returns subscription object with unsubscribe method.
  • Loading branch information
mjancarik committed Feb 16, 2023
1 parent 811ebf6 commit 2def639
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { createMonitoring } from '@esmj/monitor';

const { monitor, metricsHistory } = new createMonitoring();

const unsubscribe = monitor.subscribe((metrics) => {
const { unsubscribe } = monitor.subscribe((metrics) => {
console.log(metrics);
// {
// cpuUsage: { user: 1692, system: 925, percent: 0.26 },
Expand Down Expand Up @@ -105,7 +105,7 @@ Monitoring stop measure node metric.
#### subscribe(listener)
Subscribe listener for metrics.

Returns an unsubscribe method.
Returns a subscription object with unsubscribe method.

#### unsubscribe(listener)
Remove subscription.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,6 @@
}
},
"dependencies": {
"@esmj/observable": "^0.0.5"
"@esmj/observable": "^0.1.0"
}
}

0 comments on commit 2def639

Please sign in to comment.