UNPKG

astro

Version:

Astro is a modern site builder with web best practices, performance, and DX front-of-mind.

18 lines (17 loc) • 386 B
import { ContentLayer } from "./content-layer.js"; function contentLayerSingleton() { let instance = null; return { init: (options) => { instance?.dispose(); instance = new ContentLayer(options); return instance; }, get: () => instance, dispose: () => { instance?.dispose(); instance = null; } }; } export const globalContentLayer = contentLayerSingleton();