flatiron/broadway — Issue #10: Pass app as a parameter to plugins
Author: Raynos
Created: 2011-12-21 12:52:46+00:00
State: open

Currently to access the application within a plugin you have to use `this` in `.attach`.

This becomes painful when you use a function like [`_.bindAll`][1] on your plugin. Since you no longer have access to the app in your attach function.

It's also painful because I can't call other methods of the plugin in the `attach` function using `this`.

I suggest changing the signatures to

- `attach(options, app);`
- `init(done, app);`
- `detach(app);`

This will give plugin writes a little more freedom in how they arrange their plugin and how they interact with the application.

[1]: http://documentcloud.github.com/underscore/#bindAll