Fix typos for onWillClose in usage and types

This commit is contained in:
Jakub Ďuraš 2018-09-20 11:00:34 +02:00
parent 61caa4f6f9
commit 564a326d50
No known key found for this signature in database
GPG key ID: 70A35C25F9072BF2
2 changed files with 3 additions and 3 deletions

View file

@ -218,10 +218,10 @@ unsubscribe();
### `onWillClose(callback)`
A callback which will be called when Webamp is _about to_ closed. Returns an "unsubscribe" function. The callback will be passed a `cancel` function which you can use to conditionally prevent Webamp from being closed.
A callback which will be called when Webamp is _about to_ close. Returns an "unsubscribe" function. The callback will be passed a `cancel` function which you can use to conditionally prevent Webamp from being closed.
```JavaScript
const unsubscribe = webamp.onClose((cancel) => {
const unsubscribe = webamp.onWillClose((cancel) => {
if (!window.confirm("Are you sure you want to close Webamp?")) {
cancel();
}

2
index.d.ts vendored
View file

@ -161,7 +161,7 @@ export default class Webamp {
public onTrackDidChange(callback: (track: Track) => any): () => void;
/**
* A callback which will be called when Webamp is _about to_ closed. Returns an
* A callback which will be called when Webamp is _about to_ close. Returns an
* "unsubscribe" function. The callback will be passed a `cancel` function
* which you can use to conditionally prevent Webamp from being closed.
*