Return this after initialize so you can initialize it in 1 line
This commit is contained in:
parent
641f695f9f
commit
f4fd1db926
|
|
@ -10,3 +10,10 @@ ytmusic.initialize().then(() => {
|
||||||
// Use API here
|
// 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
|
||||||
|
```
|
||||||
|
|
|
||||||
|
|
@ -104,6 +104,8 @@ export default class YTMusic {
|
||||||
...config
|
...config
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue