Skip to content

Instantly share code, notes, and snippets.

@aqrojo
Created April 7, 2021 23:37
Show Gist options
  • Save aqrojo/41c875f902eb8c3dc57a9022e6533958 to your computer and use it in GitHub Desktop.
Save aqrojo/41c875f902eb8c3dc57a9022e6533958 to your computer and use it in GitHub Desktop.
mobx-introduction_MST_composition
const TemperatureModel = types.model({
id: types.string,
value: types.number
})
const CelsiusTemperature = types.compose (
TemperatureModel,
types
.model ({})
.views (state => ({
get farenheight () {
return (state.celsius * (9/5)) + 32
},
}))
)
const FarenheightTemperature = types.compose (TemperatureModel, ...)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment