interface MyType {
id: string;
name: string;
}
class Store {
@observable byId: { [id: string]: MyType } = {};
@computed get list(): MyType[] {
return this.byId.values();
}
}
I'm getting this error on the .values():
Cannot invoke an expression whose type lacks a call signature.
Type 'MyType' has no compatible call signatures.
What would be a proper way to define byId so that .values is available and returns MyType[]? Is there a generic type for this?
Found it!
@observable byId = new ObservableMap<MyType>();
Most helpful comment
Found it!
@observable byId = new ObservableMap<MyType>();