Return this after initialize so you can initialize it in 1 line

This commit is contained in:
Zechariah 2022-03-30 23:20:40 +08:00
parent 641f695f9f
commit f4fd1db926
2 changed files with 9 additions and 0 deletions

View File

@ -10,3 +10,10 @@ ytmusic.initialize().then(() => {
// Use API here
})
```
In an async context, you can initialize the API in one line
```ts
const ytmusic = await new YTMusic().initalize()
// Use API here
```

View File

@ -104,6 +104,8 @@ export default class YTMusic {
...config
}
}
return this
}
/**