Skip to content

Instantly share code, notes, and snippets.

@DavidSanwald
Last active September 26, 2018 13:46
Show Gist options
  • Save DavidSanwald/78c22d0df31d5e564d29fafc19b52bc2 to your computer and use it in GitHub Desktop.
Save DavidSanwald/78c22d0df31d5e564d29fafc19b52bc2 to your computer and use it in GitHub Desktop.
Prototyping D3 charts inside React
const peek = ({ color = 'red', text = 'logged value:', weight = 'bold' } = {}) => x => {
const logContent = `%c ${text} ${x}`
const style = `color: ${color}; font-weight: ${weight};`
console.log(logContent, style)
return x
}
const peekGreen = peek({color: 'green'})
const result = 1+peekGreen(1+1)
// "logged value: 2"
console.log(result)
// 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment