Last active
May 20, 2019 01:08
-
-
Save mariotacke/9f6a94691ea44ead90f5dbdeb0524e99 to your computer and use it in GitHub Desktop.
blog-real-time-word-cloud
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
async function getCloud () { | |
const response = await fetch('/api/channel/$CHANNEL_NAME/words'); | |
const json = await response.json(); | |
const cloud = json.scores.map(function ({ key, value }) { | |
return { text: key, size: value }; | |
}); | |
return cloud; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment