LeanKit-Labs/lux.js — pull request #17 by dcneiner (2014-10-08 18:30:25+00:00)
Title: Added new mixin method to support

This adds support for a top level `lux.mixin( context )` method that can be used to mix Lux into any object. From the updated Readme:

> The `lux.mixin()` method allows you to add support for lux stores and actions into any object. *You will not need to use this on React components or existing lux components.* Simply call `lux.mixin( this )` on your object, and lux will do the following steps:

> 1. If it finds a `stores` property on your object it will wire up stores and store handlers (Including adding the `loadState` method to your object).
> 2. If it finds a `getActionsFor` property on your object it will add top level methods for the needed actions.
> 3. It will add a `luxCleanup()` method to your object. Invoke this method during a destroy or teardown lifecycle event to cleanup the mixin's subscriptions.