Skip to content

@scribe-atp/vue

function useScribeSite(author: string, siteSlug: string): UseScribeSiteResult
interface UseScribeSiteResult {
site: Ref<Site | null>;
loading: Ref<boolean>;
error: Ref<Error | null>;
}

Fetches a site when the composable is called and aborts the request when the host component is unmounted. Returns reactive refs.

ParameterTypeDescription
authorstringAuthor handle or DID
siteSlugstringSite rkey — derive with toSlug(domain)

While loading, site.value is null and loading.value is true. On error, error.value is set. AbortError is swallowed.


function useScribeArticle(author: string, articleSlug: string): UseScribeArticleResult
interface UseScribeArticleResult {
article: Ref<Article | null>;
loading: Ref<boolean>;
error: Ref<Error | null>;
}

Fetches an article when the composable is called and aborts on unmount. Returns reactive refs.

ParameterTypeDescription
authorstringAuthor handle or DID
articleSlugstringArticle rkey / slug

All types from @scribe-atp/core are re-exported:

import type { Site, Article, ArticleRef, SiteGroup } from '@scribe-atp/vue';

See the core reference for type definitions.