Skip to content

Commit

Permalink
Updated migration guide for v4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisn committed Nov 30, 2024
1 parent fcfa24d commit 8a3cd2f
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions doc/migration-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,29 @@

This document describes any breaking changes in the Peaks.js API and provides advice on how to migrate your code to the updated API.

## Peaks.js v4.0.0

The `peaks.ready` event has been removed in Peaks.js v4.0.0. Instead of using this event, applications must now pass a callback function to `Peaks.init()`. This enables error handling, which is only possible using the callback function.

```js
// Before
const peaks = Peaks.init(options);

peaks.on('peaks.ready', function() {
// etc
});

// After
Peaks.init(options, function(err, peaks) {
if (err) {
// Handle errors here.
return;
}

// etc
});
```

## Peaks.js v3.0.0

Peaks.js v3.0.0 introduces a number of changes, described in the following sections.
Expand Down

0 comments on commit 8a3cd2f

Please sign in to comment.