This section shows you how we start to use Verge.
It’s very basic usage. You need to read Advanced Usage section if you’re considering to use in production.
To understand smoothly about Verge, we need to figure the following domains out.
Domains
Store
- A storage object to manage a state and emit activities by the action.
- Store can dispatch actions to itself.
State
- A type of state-tree that describes the data our feature needs.
Activity (Optional)
- A type that describes an activity that happens during performs the action.
- This instance won’t be stored in anywhere. It would help us to perform something by event-driven.
- Consider to use this depends on that if can be represented as a state.
- For example, to present alert or notifcitaions by the action.
Action
- Action runs any operations (sync / async) and commits any mutations to the state of the store.
- Action is described by Swift’s method in Store or Dispatcher.
Dispatcher (Optional)
- A type to dispatch an action to specific store.