You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add `RecordOf<TProps>` type alias for TypeScript
The `Record.Factory` API is great but the current definitions lack a simple way to reference instances of a record (created from a record factory). This adds a `RecordOf<TProps>` which can be used to create interfaces containing records:
```ts
import { Record, RecordOf } from "immutable";
interface Foo {
flag: boolean;
message: string;
}
const FooRecord = Record<Foo>({
flag: false,
message: "DEFAULT"
});
interface Bar {
foo: RecordOf<Foo>;
}
const bar: Bar = {
foo: new FooRecord({ flag: true })
}
```
Currently I've been creating this type in every library so that I can refer to instances and I think Flow has support for something similar.
* Made the record instance `ReadOnly`
* Fixed typo in `Readonly` and ran prettier
0 commit comments