From b2ca7b964fd859e8e4737a857981629a5e10af6b Mon Sep 17 00:00:00 2001 From: zeim839 Date: Thu, 16 Mar 2023 14:06:58 -0400 Subject: [PATCH] fix: cache not rendering for async functions --- utils/cache.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/cache.js b/utils/cache.js index 3f36606..7c13c83 100644 --- a/utils/cache.js +++ b/utils/cache.js @@ -6,12 +6,12 @@ class Cache { this.process = null } - register (...callbacks) { + async register (...callbacks) { for (let i = 0; i < callbacks.length; i++) { this.callbacks.push(callbacks[i]) // Call callback immediately so that Cache() // outputs are defined. - const response = callbacks[i]() + const response = await callbacks[i]() this.state = { ...this.state, ...response } } }