We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d184f45 commit f908babCopy full SHA for f908bab
assets/js/components/diagram.js
@@ -1,6 +1,12 @@
1
+// Memoize the mermaid module import
2
+let mermaidPromise = null;
3
+
4
export default function Diagram({ component }) {
- // Import mermaid.js module
- import('mermaid').then(({ default: mermaid }) => {
5
+ // Import mermaid.js module (memoized)
6
+ if (!mermaidPromise) {
7
+ mermaidPromise = import('mermaid');
8
+ }
9
+ mermaidPromise.then(({ default: mermaid }) => {
10
// Configure mermaid with InfluxData theming
11
mermaid.initialize({
12
startOnLoad: false, // We'll manually call run()
0 commit comments