It seems that the Record type is completely under documented. Both in the documentation and flow files.
Since the Record type is an extension of the Map type (contains getIn, hashCode, etc.) I think this should be better documented to avoid confusion.
I've run into this as well when using Flow. I've yet to find a good way of typing immutable objects the same way one can type the shape of plain JS objects.
@iansinnott Immutable.Record (as opposed to Immutable.Map) is completely describable by Flow.
type MyRecord = Immutable.Record<{ id: number, name: string }>;
const MyRecord = Immutable.Record({ id: 0, name: undefined });
The problem is that while the Immutable declaration declares it as an Immutable.Record type it doesn't extend the Map type.
Yeah I think we're talking about the same thing. It becomes an issue because although the shape of the record is typed it doesn't have the get, getIn, etc, methods which one usually uses. So flow ends up throwing invalid errors.
Will be fixed in the upcoming release
Most helpful comment
Will be fixed in the upcoming release