From 8025665eec0d02f67d6333cd10a6826c6703bb28 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sun, 11 Jun 2023 13:26:29 -0300 Subject: infra: quick code style changes --- src/content-function.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/content-function.js') diff --git a/src/content-function.js b/src/content-function.js index 7b975e6..3f9d658 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); } -- cgit 1.3.0-6-gf8a5