Skip to content

Instantly share code, notes, and snippets.

Gabriele Petronella gabro

Block or report user

Report or block gabro

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
@gabro
gabro / validation.flow.js
Last active Nov 23, 2018
Dynamic object validation using $ObjMap in Flow
View validation.flow.js
/* @flow */
// A simplified representation of types using phantom types (so that we store the Type information both at value and type level)
class Type<T> {};
class StringT extends Type<string> {}
class NumberT extends Type<number> {}
// A schema for a User
const User = {
name: new StringT(),
You can’t perform that action at this time.