Complete residential site build with Docker Compose & Gitea Actions deployment
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
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;
|
||||
}
|
||||
};
|
||||
}
|
||||
const globalContentLayer = contentLayerSingleton();
|
||||
export {
|
||||
globalContentLayer
|
||||
};
|
||||
Reference in New Issue
Block a user