Quick start
{
"name": "Robbie"
}const myPet = M.fromJSON(Animal, petJson)
myPet.speak() // => 'my name is Robbie!'const M = require('modelico')
class Animal extends M.createModel(m => ({
name: m.string()
})) {
speak() {
const name = this.name()
return (name === '') ? `I don't have a name` : `My name is ${name}!`
}
}Last updated