Eric Bower
·
17 Aug 24
models.md
1---
2title: Models
3description: State management in starfx
4---
5
6One core component of an MVC framework is the Model.
7
8Since data normalization is a first-class citizen inside `starfx`, we built a
9custom, reactive database for front-end web apps. Like a backend MVC framework,
10we want to think of managing the FE store like managing a database. So while
11thinking about models as separate entities, you create all your models by
12creating a single schema.
13
14Managing models in `starfx` leverages two primary concepts: schema and store.
15
16The store is a single, global, and reactive object that was built to make
17updating views easy. It is essentially an event emitter with a javascript object
18that is updated in a very particular way (via `schema.update`).
19
20Because the goal of this library is to create scalable web apps, we want users
21to create all their models at the same time inside a single schema.