Skip to content

Instantly share code, notes, and snippets.

@James-Bovis
Last active October 11, 2019 17:30
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 James-Bovis/d03a5243bfd9c1b6236df446b29ba44e to your computer and use it in GitHub Desktop.
Save James-Bovis/d03a5243bfd9c1b6236df446b29ba44e to your computer and use it in GitHub Desktop.
Random Placeholder Text from Array
const generateRandomPaceholder = (name: string): string => {
const placeholders = [
`For example, ${name} loves a good belly scratch and long walks at twilight on the beach.`,
`For example, ${name} is a legend and a great dog`,
`For example, ${name} is the best dog I could have ever wished for`,
`For example, ${name} makes me so happy my heart hurts`
]
const placeholderText = placeholders[Math.floor(Math.random() * placeholders.length)]
return (placeholderText)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment