The purpose of data models is a globally scoped place to keep data. When a data model is constructed from an object, it is recursively mutated to observe changes and send events using callbacks. The following example shows how to create a data model.
elytra.add("model", {
text: "Hello World!",
count: 0
});
Once the data model is created, it is a member of the elytra namespace. Now, properties can be get and set in the following ways.
elytra.model.text = "Oh no!";
console.log(elytra.model.text.value);
elytra.mode.count.value++;