Closed BrianHung closed 9 months ago
So, I expected that types.map(types.string).create()
would work with:
[string, any][]
IKeyValueMap<any>
Map<string, any>
undefined
It seems to only work with 2 and 4. See here.
The typings on that initialData
parameter for the constructor seem to get modified somewhere between the MSTMap
definition, and exposing types.map
export. I don't totally see where/how.
I'm going to write a test that just tests 2/4, and I think it'll work out here. We also don't seem to allow users to call that constructor directly anyway, so I feel good about this change. I'll push a commit and merge.
Sorry, I've been busy with work; thanks for taking up the effort to write tests ❤️
Happy to! Tryna clean up PRs so I can muck around with the folder structure lol
What does this PR do and why?
MobX has an exported type
IObservableMapInitialValues
for itsinitialData
. SinceMSTMap
extendsObservableMap
, it makes sense thatMSTMap
should use the same type.