mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-23 10:07:35 +00:00
Fix typos for onWillClose in usage and types
This commit is contained in:
parent
61caa4f6f9
commit
564a326d50
2 changed files with 3 additions and 3 deletions
|
|
@ -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
2
index.d.ts
vendored
|
|
@ -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.
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue