Last active
September 26, 2018 13:46
-
-
Save DavidSanwald/78c22d0df31d5e564d29fafc19b52bc2 to your computer and use it in GitHub Desktop.
Prototyping D3 charts inside React
This file contains 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
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