feat(BaseFontStore): expose error getter

This commit is contained in:
Ilia Mashkov
2026-04-05 11:03:00 +03:00
parent b40e651be4
commit a1a1fcf39d

View File

@@ -117,6 +117,11 @@ export abstract class BaseFontStore<TParams extends Record<string, any>> {
return this.result.isError; return this.result.isError;
} }
/** The error from the last failed fetch, or null if no error. */
get error(): Error | null {
return this.result.error ?? null;
}
/** Whether no fonts are loaded (not loading and empty array) */ /** Whether no fonts are loaded (not loading and empty array) */
get isEmpty() { get isEmpty() {
return !this.isLoading && this.fonts.length === 0; return !this.isLoading && this.fonts.length === 0;