pl-api: bump version

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2024-10-29 22:51:35 +01:00
parent 7b183e5c60
commit ac3910ac8f
2 changed files with 10 additions and 3 deletions

View file

@ -248,9 +248,16 @@ class PlApiClient {
close: () => void;
};
constructor(baseURL: string, accessToken?: string, { instance, fetchInstance }: {
constructor(baseURL: string, accessToken?: string, {
instance,
fetchInstance,
onInstanceFetchSuccess,
onInstanceFetchError,
}: {
instance?: Instance;
fetchInstance?: boolean;
onInstanceFetchSuccess?: (instance: Instance) => void;
onInstanceFetchError?: (error?: any) => void;
} = {}) {
this.baseURL = baseURL;
this.#accessToken = accessToken;
@ -259,7 +266,7 @@ class PlApiClient {
this.#setInstance(instance);
}
if (fetchInstance) {
this.instance.getInstance();
this.instance.getInstance().then(onInstanceFetchSuccess).catch(onInstanceFetchError);
}
}

View file

@ -1,6 +1,6 @@
{
"name": "pl-api",
"version": "0.1.5",
"version": "0.1.6",
"type": "module",
"homepage": "https://github.com/mkljczk/pl-fe/tree/fork/packages/pl-api",
"repository": {