-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Using Immutable.js’s Maps with TypeScript #683
Copy link
Copy link
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 😄
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels