Skip to content

Commit

Permalink
fix: cache not rendering for async functions
Browse files Browse the repository at this point in the history
  • Loading branch information
zeim839 committed Mar 16, 2023
1 parent caca3fc commit b2ca7b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
}
}
Expand Down

0 comments on commit b2ca7b9

Please sign in to comment.