Update: Icarus received a mention in the book Getting Started with Twitter Flight by Tom Hamshere.
Icarus is a JavaScript framework that combines event-driven architecture with MV* patterns. Built on top of Twitter Flight, it uses a modified version of Laces.js for model implementation. The source code is available on Github.
Introduction
Icarus takes the component-based, event-driven approach of Twitter Flight and layers on model management inspired by MV* frameworks. Components remain completely independent, communicating solely through events, while models provide structured state management via a modified Laces.js.
Why I Wrote Icarus
Twitter Flight excels at decoupling UI components, but it leaves state management largely to the developer. Icarus bridges this gap by introducing a lightweight model layer that integrates naturally with Flight's event system, giving developers the best of both worlds: loose coupling and predictable state.
Usage
Icarus models are attached to Flight components and expose a consistent API for reading, writing, and observing data changes. Models can be bound to DOM elements, other models, or plain JavaScript objects, with automatic synchronization driven by events.
Model Methods
initModel
Initializes a new model instance on a component. Accepts a configuration object that defines the model's initial state and binding rules.
removeModel
Tears down a model, cleaning up all bindings and event listeners associated with it.
set
Updates one or more model properties. Triggers change events that propagate through the binding graph, keeping all connected views and dependent models in sync.
get
Retrieves the current value of a model property. Returns a plain JavaScript value, not a reference to internal state.
remove
Deletes a property from the model and notifies bound consumers of the removal.
bind
Establishes a live connection between a model property and a target — a DOM element, another model, or a plain object. Changes flow automatically in the specified direction.
Binding Types
Events
Model changes emit events that Flight components can listen to, preserving the decoupled architecture that Flight is known for.
Objects
Models can bind directly to plain JavaScript objects, making it straightforward to integrate Icarus with existing code or third-party libraries.
Arrays
Array bindings support collection-style data, with efficient diffing to minimize DOM updates when list contents change.
Some Thoughts
Icarus is an experiment in blending two architectural philosophies. The event-driven side keeps components isolated and testable; the model side brings structure to state that would otherwise scatter across components. The result is a framework that feels lightweight but handles complexity well as applications grow.
What Is Next?
The project is open for exploration and feedback. Check out the Github repository to dive into the code, try the examples, and contribute ideas.