Skip to content

Component lifecycles

briancavalier edited this page Jun 17, 2011 · 3 revisions

Each component in a wire spec has a well-defined lifecycle that is managed by wire.js. When wire.js processes the spec to create a context, the components in the spec will go through the following lifecycle stages:

  1. Create
  2. Configure
  3. Initialize
  4. Ready
  5. Destroy

During the Create stage, a factory creates the component instance. Then, during each lifecycle stage (including Create), various facets will be applied to the instance.

When a context is destroyed by calling its destroy() method, the components will go through a final stage. During the Destroy phase, facets can also be applied, although typically these will be specialized facets that help clean up the component and its resources.

Clone this wiki locally