Skip to content

Instantly share code, notes, and snippets.

@jkk
Created March 14, 2017 22:08
Show Gist options
  • Save jkk/41f66940243f2b10c8b38b56ae83d310 to your computer and use it in GitHub Desktop.
Save jkk/41f66940243f2b10c8b38b56ae83d310 to your computer and use it in GitHub Desktop.
// @flow
import {Record} from 'immutable';
const TestRec = Record({a: 0, b: 0});
// Flow gives an error for the `rec` argument's type:
//
// RecordClass
// Ineligible value used in/as type annotation (did you forget 'typeof'?)
// TestRec
//
// Am I doing it wrong? Is there a type that can be used here? `typeof TestRec`
// does not work, nor do any other variations I've tried.
function handleRec(rec: TestRec) {
console.log(rec.a);
}
const myRec = TestRec();
handleRec(myRec);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment