Skip to content

Instantly share code, notes, and snippets.

View hiddenmemory's full-sized avatar

hiddenGithub hiddenmemory

View GitHub Profile
@almost
almost / proposal.md
Last active September 12, 2019 09:07
Reactive 2016 Lightning Talk Proposal: Get Flow

This is a proposal for a lightning talk at the Reactive 2016 conference.

NOTE: If you like this, star ⭐ the Gist - the amount of stars decides whether it makes the cut! You could also Retweet if you want :)

Get Flow

Type checking JavaScript with Flow

JavaScript is a dynamic language, and there's nothing wrong with that. It allows quick iteration and lowers barriers. However, sometimes some compile-time type checking is just what you need to keep your code in line and give yourself the confidence to build bigger and faster. Flow gives the best of both worlds. You can have normal JavaScript but you can also add types where they're helpful, and it adds zero cost at runtime. In this talk I'll show Flow as it applies to a Redux & React codebase.

import Darwin
// Swift hates uninitialized values but we need to create stuff without
// an explicit initial value. This protocol is for anything that can be
// created with any sort of default value (e.g. all integer types init
// with zero.
protocol Initable {
init()