How to use random-unicode-emoji - 2 common examples

To help you get started, we’ve selected a few random-unicode-emoji examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github react-spring / react-spring / examples / demos / chat / index.js View on Github external
function addItem(state) {
  const items = [...state.items]
  const previous = state.items[state.items.length - 1]
  const left = Math.round(Math.random()) === 1
  const first = previous === undefined || previous.left !== left
  const text =
    lorem() +
    (Math.round(Math.random()) ? '' : ` ${emoji.random({ count: 1 })}`)
  if (previous !== undefined) previous.last = first
  items.push({ key: state.items.length, text, left, first, last: true })
  return { items }
}
github react-spring / react-spring-examples / demos / renderprops / chat / index.js View on Github external
function addItem(state) {
  const items = [...state.items]
  const previous = state.items[state.items.length - 1]
  const left = Math.round(Math.random()) === 1
  const first = previous === undefined || previous.left !== left
  const text =
    lorem() +
    (Math.round(Math.random()) ? '' : ` ${emoji.random({ count: 1 })}`)
  if (previous !== undefined) previous.last = first
  items.push({ key: state.items.length, text, left, first, last: true })
  return { items }
}

random-unicode-emoji

A simple JavaScript package that returns random Unicode emojis. 📜

ISC
Latest version published 2 years ago

Package Health Score

46 / 100
Full package analysis

Popular random-unicode-emoji functions