Skip to content

Instantly share code, notes, and snippets.

Tyler Collier tylercollier

  • Email: github2 at my first and last name dot com
  • Phoenix, AZ, USA
Block or report user

Report or block tylercollier

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tylercollier
tylercollier / renderprops.js
Last active Nov 29, 2016
RenderProps challenges
View renderprops.js
// Using RenderProps (https://github.com/ReactTraining/react-subjects/blob/master/subjects/RenderProps/exercise.js),
// how can I:
//
// 1) compose multiple fetches to be run simultaneously? In the example below, fetching credits would be blocked until
// debits have been fetched.
//
// 2) test the component without the fetches happening? Normally I'll have a component that takes props, and connect it
// to redux, and export both the connected component (as default) and the so-called presentational component as a named
// const. This allows me to preview the render using e.g. React Storybook.
View callbacks.js
// Callbacks!
// Reminder: Run this with quokka if you want to see results instantly in your editor.
// https://quokkajs.com/
// Part 1
// If I gave you an array of numbers, and told you to list just the odds, you might do this:
var numbers = [1, 2, 3, 4, 5, 6];
var odds = [];
@tylercollier
tylercollier / setTimeout.js
Last active May 14, 2019
medium-article-closures
View setTimeout.js
const message = 'hello from a closure'
setTimeout(() => {
console.log(message)
}, 1000)
// or, same thing on one line
setTimeout(() => console.log(message), 1000)
You can’t perform that action at this time.