Skip to content

Instantly share code, notes, and snippets.

@freddi301
Last active November 27, 2018 12:58
Show Gist options
  • Save freddi301/b7bb826795c27094ae5ee52ebf8f2110 to your computer and use it in GitHub Desktop.
Save freddi301/b7bb826795c27094ae5ee52ebf8f2110 to your computer and use it in GitHub Desktop.
Frontend Architecture
view:
component: composition of
helper: prepare data for template so no code goes into the tempalte
template: does only view, can dispatch events
container: composition of
injector: grabs data from state
wireframe: conecptual representation of ui, it's a projections of data to display and possible actions
domain:
data: typeos of data in the domain (anemic value objects)
state: structure od underivable domain data that represents the state of the world
event: used to trigger state transitions
common data:
tasks
async data
projections: pure functions given domain data returns domain data
transitions: given an event and state returns next state
common projections:
localization (label, language) => text (goes into helper)
authorization (state, user) => actions (goes into injector)
theming (theme) => Map<Container, Component>
state and transitions should represent a finite state machine that tells:
flow of the application
what the user sees now
what the user can do
template(helper(wireframe(injector(state))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment