frontend/composables/AccountAcct.ts

18 lines
417 B
TypeScript
Raw Normal View History

2024-12-02 16:07:52 +01:00
import type { Client } from "@versia/client";
import type { Account } from "@versia/client/types";
export const useAccountFromAcct = (
client: MaybeRef<Client | null>,
acct: string,
): Ref<Account | null> => {
const output = ref(null as Account | null);
ref(client)
.value?.lookupAccount(acct)
.then((res) => {
output.value = res.data;
});
return output;
};