Repository navigation
How to make a model for array? #2240
|
I guess the answer should be something trivial, as MobX has observable arrays and maps. Say we have a Details I'm making a sandbox project with the PetStore API. I declared a model for the For example, speaking swr: const { data } = useSWR('list', () => api.pet.findPetsByStatus({ status: ['available'] }))
const pets = data?.dataNow pets should be of the |
Answered by
coolsoftwaretyler
Jan 11, 2025
Replies: 1 comment 7 replies
|
You probably want the array type: https://mobx-state-tree.js.org/API/#array |
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Ok, so just to see if we're on the same page. Is this the kind of logic you want to implement? And if so, is it missing something that you need?
Or have I still misunderstood what you're trying to do?
See in CodeSandbox