Home / Function/ dataStoreSingleton() — astro Function Reference

dataStoreSingleton() — astro Function Reference

Architecture documentation for the dataStoreSingleton() function in data-store.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  870f3dbd_a127_94fc_201e_63ec494e65e9["dataStoreSingleton()"]
  dabf6768_9542_21ce_e4c4_299b1540a491["data-store.ts"]
  870f3dbd_a127_94fc_201e_63ec494e65e9 -->|defined in| dabf6768_9542_21ce_e4c4_299b1540a491
  6a6d9079_941e_e9bb_9299_6752c713dce4["fromModule()"]
  870f3dbd_a127_94fc_201e_63ec494e65e9 -->|calls| 6a6d9079_941e_e9bb_9299_6752c713dce4
  style 870f3dbd_a127_94fc_201e_63ec494e65e9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/content/data-store.ts lines 110–123

function dataStoreSingleton() {
	let instance: Promise<ImmutableDataStore> | ImmutableDataStore | undefined = undefined;
	return {
		get: async () => {
			if (!instance) {
				instance = ImmutableDataStore.fromModule();
			}
			return instance;
		},
		set: (store: ImmutableDataStore) => {
			instance = store;
		},
	};
}

Subdomains

Calls

Frequently Asked Questions

What does dataStoreSingleton() do?
dataStoreSingleton() is a function in the astro codebase, defined in packages/astro/src/content/data-store.ts.
Where is dataStoreSingleton() defined?
dataStoreSingleton() is defined in packages/astro/src/content/data-store.ts at line 110.
What does dataStoreSingleton() call?
dataStoreSingleton() calls 1 function(s): fromModule.

Analyze Your Own Codebase

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

Try Supermodel Free