Skip to content

Instantly share code, notes, and snippets.

View fongandrew's full-sized avatar

Andrew Fong fongandrew

View GitHub Profile
@fongandrew
fongandrew / react-bind.md
Last active January 14, 2024 16:02
Explaining why we bind things in React

Start With This

Before getting to React, it's helpful to know what this does generally in Javascript. Take the following snippet of code. It's written in ES6 but the principles for this predate ES6.

class Dog {
  constructor() {
@fongandrew
fongandrew / Terrible.js
Created January 10, 2020 20:37
For funsies
// npm install if
const If = require('if');
const f = (c, t, f) => If(c).Then(t).Else(f);