Closed
Description
I'm using immutable.js with TypeScript. I want a typed immutable object, e.g. an object called Person
with an interface of: (name: string, age: number)
.
Ideally I could construct a Person
and it will be an instance of Immutable.Map
:
interface Person {
name: string;
age: number
}
var person = Person({ name: 'bob', age: 5 })
person.name // => 'bob'
var newPerson = person.set('name', 'harry');
person.name // => 'bob'
newPerson.name // => 'harry'
Is this possible? Sorry if my terminology is not entirely clear!
Thanks 😄
Metadata
Metadata
Assignees
Labels
No labels