Created
March 14, 2017 22:08
-
-
Save jkk/41f66940243f2b10c8b38b56ae83d310 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @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