frontend-rw #1

Merged
marcin merged 347 commits from frontend-rw into develop 2024-12-05 15:32:18 -08:00
2 changed files with 10 additions and 3 deletions
Showing only changes of commit ac3910ac8f - Show all commits

View file

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

View file

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