Skip to content
This repository has been archived by the owner on Apr 19, 2020. It is now read-only.

Latest commit

 

History

History
26 lines (20 loc) · 823 Bytes

components.md

File metadata and controls

26 lines (20 loc) · 823 Bytes

Components

What are Components

Flexblock uses Mount to manage application state. These states are used to manage external resources, such as an HTTP server, or a Database. States that manage these external resources are called (in Flexblock, not in Mount) components.

Structure of a Component

Components contain two functions: a :start function, responsible for initializing the component, and optionally a :stop function that cleans up the state. Note that some components do not have stop functions. Components look like this:

(mount/defstate
  "A docstring that describes how the component works."
  :start (start-function)
  :stop (stop-function))

For more information on components, see Mount's documentation.