« get me outta code hell

infra: quick code style changes - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-06-11 13:26:29 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-06-11 13:26:29 -0300
commit8025665eec0d02f67d6333cd10a6826c6703bb28 (patch)
tree9248c7c81b3e452244b2789a0a51cf4931dc6590
parentbd2862e1b194d72fd403626897bf559a1eba9107 (diff)
infra: quick code style changes
-rw-r--r--src/content-function.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/content-function.js b/src/content-function.js
index 7b975e6a..3f9d658a 100644
--- a/src/content-function.js
+++ b/src/content-function.js
@@ -118,12 +118,12 @@ export function expectDependencies({
       }
     };
 
-    annotateFunction(wrappedGenerate, {name: generate, trait: 'fulfilled'});
-    wrappedGenerate.fulfilled = true;
-
     wrappedGenerate.fulfill = function() {
       throw new Error(`All dependencies already fulfilled (${generate.name})`);
     };
+
+    annotateFunction(wrappedGenerate, {name: generate, trait: 'fulfilled'});
+    wrappedGenerate.fulfilled = true;
   }
 
   wrappedGenerate[contentFunction.identifyingSymbol] = true;
@@ -222,7 +222,11 @@ export function fulfillDependencies(dependencies, {
       continue;
     }
 
-    const isContentFunction = !!value?.[contentFunction.identifyingSymbol];
+    const isContentFunction =
+      !!value?.[contentFunction.identifyingSymbol];
+
+    const isFulfilledContentFunction =
+      isContentFunction && value.fulfilled;
 
     if (isContentKey) {
       if (!isContentFunction) {
@@ -230,7 +234,7 @@ export function fulfillDependencies(dependencies, {
         continue;
       }
 
-      if (!value.fulfilled) {
+      if (!isFulfilledContentFunction) {
         invalidatingDependencyKeys.add(key);
       }