Skip to content

Instantly share code, notes, and snippets.

View whichsteveyp's full-sized avatar

Stephen Rivas Jr whichsteveyp

View GitHub Profile
@whichsteveyp
whichsteveyp / children-as-function.js
Last active May 25, 2016 02:11 — forked from iammerrick/children-as-function.js
Which API do you prefer? Passing a function into the Ratio component or making a higher order component called Ratio you can use to configure a component.
// parent A wants to show a list
<GetLastNImagesOfType type="jpg" numImages={10}>
{(images) => {
return images.map(image => <span>{image.name}</span>)
}}
</GetLastNImagesOfType>
// parent B wants to show the images themselves
<GetLastNImagesOfType type="jpg" numImages={10}>
{(images) => {
source ~/.git-completion.sh
source ~/.git-prompt.sh
export PS1='\n\n\[\e[0;36m\][ \[\e[0;35m\]\w\[\e[0;36m\] ] $(__git_ps1 "\[\e[1;33m\]%s\[\e[0;36m\]") >\[\e[0m\] '