Closed alexamy closed 1 year ago
I'm thinking it might be worth changing the todos
in the tutorial from a map to an array?
This way we will use a map for the Users
and an array for the todos
showcasing both data types, and we don't have to use values
or Array.from(todos.values())
in the introduction, which might be a bit more of a complex use case.
Just some food for thought, @jamonholmgren will have better input on this than me.
I agree it would make more sense to use an array there. Either of you want to tackle that? 😀
I'll try to do that and make new typescript playgrounds by the way.
Making sure the code in the Getting Started tutorial doesn't cause trouble when ported to TypeScript is one thing, but I think we still want to keep it in JavaScript.
Ok, I'll revert all typescript related changes.
@EmilTholin I've reverted changes to just replacing values
from mobx to native Array.from
/ values
call. I think other changes (convert todos from object to array) can be done in separate PR.
Follow up for https://github.com/mobxjs/mobx-state-tree/discussions/1981.
Problem
There is a typing error when using Mobx utility
values
on MSTmap
collection. You can see it in this playground (fortodo.name
on line 23).Solution
Use native Map method
values
withArray.from
:Other updates
array
for Todos