Created
August 5, 2019 21:33
-
-
Save Fleker/a9db5b186dcb644b8804afd675d03fc6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.middleware(async (conv: Conv) => { | |
await cacheResults(conv) | |
}) | |
async function cacheResults(conv: Conv) { | |
if (!conv.data.json) { | |
const response = await fetch(tabletopAudioUrl) | |
const json: TabletopAudioResponse = await response.json() | |
conv.data.json = json | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment