holium / ballot

An Urbit app for voting on proposals and polls.
MIT License
2 stars 0 forks source link

Move from `mobx` store to `mobx-state-tree` stores #4

Closed drunkplato closed 2 years ago

drunkplato commented 2 years ago

Store structure

We use a lib called mobx-state-tree to which helps us manage our state. It is organized as a tree with map hierarchies to various models.

|- booth-store
|   \
|   |- booth-model
|   |   \
|   |   |- {...booth-data}
|   |   |- participant-store
|   |   |   \
|   |   |    | - participant-model
|   |   |   /
|   |   |- proposal-store
|   |   |  \
|   |   |   |- proposal-model
|   |   |   |  \
|   |   |   |   |- {...proposal-data}
|   |   |   |   |- choices
|   |   |   |   |- poll
|   |   |   |   |  \
|   |   |   |   |   |- status
|   |   |   |   |- results
|   |   |   |   |   \
|   |   |   |   |    |- tally-model
|   |   |   |   |    |- vote-model

The above structure is implemented.