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
const TemperatureModel = types.model({ | |
id: types.string, | |
value: types.number | |
}) | |
const CelsiusTemperature = types.compose ( | |
TemperatureModel, | |
types | |
.model ({}) | |
.views (state => ({ |
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) | |
}) |
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 { types } from 'mobx-state-tree' | |
// definición de un modelo mobx-state-tree | |
const ThermometerModel = types | |
.model({ | |
id: types.string, | |
celsius: types.number | |
}) | |
.actions (state => ({ | |
setCelsius (val) { |
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 { observable } from 'mobx' | |
import { observer } from 'mobx-react' | |
const store = observable({ | |
prop1: 1, | |
prop2: 2, | |
... | |
}) | |
function ComponentA () { |
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
// dentro del observable Manager... | |
// promesa | |
fetchTemperatures() { | |
axios.get(...) | |
.then( | |
thermometerList.onFetchSuccess, | |
thermometerList.onFetchError, | |
) | |
} |
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
const manager = observable ({ | |
// model | |
thermometerList: [], | |
// actions | |
addThermometer() { | |
manager.thermometerList.push(getThermometer({...})) | |
} | |
}) |
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 { observable } from 'mobx' | |
function getThermomether (initialValue) { | |
const thermometer = observable({ | |
// model | |
id: initialValue.id, | |
celsius: initialValue.celsius, | |
// actions | |
setCelsius (val) { |
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
const feedback = { | |
"config": { | |
// por defecto el feedback es visible, pero podría ser modificado por una entidad superior (assesments component) | |
"visibility": true | |
// aqui se describe como se va a mostrar el feedback de error (hints) | |
// -> stack: va avanzando de uno en uno a ranzon del intento actual y permanece en el último | |
// -> cyclic: igual que stack pero reinicia al llegar al último | |
// -> random: muestra uno aleatorio cada vez | |
"sequence": "stack | cyclic | random" |
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
{ | |
"path": "assets/canciones", | |
"decoration": "fish.png", | |
"tiles": [ | |
{ | |
"title": "Canciones de los números", | |
"downloadLink": "download.zip", | |
"files": [ | |
{ | |
"title": "Archivo de audio", |
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
// ejemplo de patrón: \\(\\sqrt{2}=1,4\\ \\text{e}\\ \\sqrt{3}=1,7\\) | |
const text = "{"title":"Example title","type":"mcq","data":{"options":[{"label":"<p class=\"text-justify\">adequado, com altura de 1,15 m.</p>\n","value":"0"},{"label":"<p class=\"text-justify\">adequado, com altura de 1,40 m.</p>\n","value":"1"},{"label":"<p class=\"text-justify\">inadequado, com altura de 1,40 m.</p>\n","value":"2"},{"label":"<p class=\"text-justify\">inadequado, com altura de 1,15 m.</p>\n","value":"3"},{"label":"<p class=\"text-justify\">inadequado, com altura de 58 cm.</p>\n","value":"4"}],"stimulus":"<p class=\"text-justify\">Uma lanchonete pretende comprar mesas para os clientes fazerem refeições rápidas, feitas em pé. Para tanto, o móvel deve ter altura entre 1 m e 1,20 m.</p>\n\n<p class=\"text-justify\">O modelo que mais agradou aos administradores da lanchonete foi o representado a seguir, composto por dois tetraedros regulares alinhados, de modo que suas alturas sejam parte de uma mesma linha reta.</p>\n\n<p cla |
NewerOlder