diff --git a/docs/usage.md b/docs/usage.md index bf14ff14..dfb7e4d1 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -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(); } diff --git a/index.d.ts b/index.d.ts index 48a580a8..75491739 100644 --- a/index.d.ts +++ b/index.d.ts @@ -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. *