Skip to content

Instantly share code, notes, and snippets.

View beefancohen's full-sized avatar
🐼

Ethan Cohen beefancohen

🐼
  • Tono Health
  • Philadelphia, PA
  • X @beefan
View GitHub Profile
@slorber
slorber / do notation.js
Last active November 17, 2016 17:10
Use do { } makes React render() method more readable
// FP languages permit to evaluate if/else expressions as values.
// In many cases it permits to avoid using mutable variables (var/let), multiple returns, or nested ternary operators
// This is the do { } notation (stage 0), that permits to write the following right now with Babel.
const Users = ({users}) => (
<div>
{users.map(user =>
<UserCard key={user.id} user={user}/>