Last active
April 8, 2021 09:48
-
-
Save aqrojo/d2f7e6001137f0551e0b33d79a3dc7b2 to your computer and use it in GitHub Desktop.
mobx-introduction_MST_2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { model } from 'mobx-state-tree' | |
import ThermometerModel from './ThermometerModel' | |
const Manager = types | |
.model({ | |
thermometerList: types.array(ThermometerModel) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Aclaración:
types.model
genera lo que comúnmente conocemos en JS como un objeto, que a su vez contendrá a thermometerList, que es el array de instancias termómetroEn vez de esto y si Manager únicamente va a tener una propiedad, podemos definirlo como un array directamente: