Skip to content

Instantly share code, notes, and snippets.

@mariotacke
Last active May 20, 2019 01:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mariotacke/9f6a94691ea44ead90f5dbdeb0524e99 to your computer and use it in GitHub Desktop.
Save mariotacke/9f6a94691ea44ead90f5dbdeb0524e99 to your computer and use it in GitHub Desktop.
blog-real-time-word-cloud
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