Home / Function/ reloadContentConfigObserver() — astro Function Reference

reloadContentConfigObserver() — astro Function Reference

Architecture documentation for the reloadContentConfigObserver() function in utils.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  6820fa7c_c0e9_20cf_23d1_0ee1afd42476["reloadContentConfigObserver()"]
  7a09e708_c090_71c0_8138_7343699b1865["utils.ts"]
  6820fa7c_c0e9_20cf_23d1_0ee1afd42476 -->|defined in| 7a09e708_c090_71c0_8138_7343699b1865
  6c793dbe_77b3_414d_aedb_6d44b431caa5["loadContentConfig()"]
  6820fa7c_c0e9_20cf_23d1_0ee1afd42476 -->|calls| 6c793dbe_77b3_414d_aedb_6d44b431caa5
  9f7b1f5d_6264_645b_77b9_79aaa945256d["autogenerateCollections()"]
  6820fa7c_c0e9_20cf_23d1_0ee1afd42476 -->|calls| 9f7b1f5d_6264_645b_77b9_79aaa945256d
  style 6820fa7c_c0e9_20cf_23d1_0ee1afd42476 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/content/utils.ts lines 629–658

export async function reloadContentConfigObserver({
	observer = globalContentConfigObserver,
	...loadContentConfigOpts
}: {
	fs: typeof fsMod;
	settings: AstroSettings;
	environment: RunnableDevEnvironment;
	observer?: ContentObservable;
}) {
	observer.set({ status: 'loading' });
	try {
		let config = await loadContentConfig(loadContentConfigOpts);

		config = await autogenerateCollections({
			config,
			...loadContentConfigOpts,
		});

		if (config) {
			observer.set({ status: 'loaded', config });
		} else {
			observer.set({ status: 'does-not-exist' });
		}
	} catch (e) {
		observer.set({
			status: 'error',
			error: e instanceof Error ? e : new AstroError(AstroErrorData.UnknownContentCollectionError),
		});
	}
}

Subdomains

Frequently Asked Questions

What does reloadContentConfigObserver() do?
reloadContentConfigObserver() is a function in the astro codebase, defined in packages/astro/src/content/utils.ts.
Where is reloadContentConfigObserver() defined?
reloadContentConfigObserver() is defined in packages/astro/src/content/utils.ts at line 629.
What does reloadContentConfigObserver() call?
reloadContentConfigObserver() calls 2 function(s): autogenerateCollections, loadContentConfig.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free