Created
August 5, 2019 21:33
-
-
Save Fleker/c55cc5d88d0e87c7871f229c29d563f5 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