peterhil/flask-bulbs — pull request #1 by theY4Kman (2014-09-16 01:03:27+00:00)
Title: Use same graph instance app-wide

With inspiration from [Flask-Cache](https://github.com/thadeusb/flask-cache/blob/4b2feebbcb53aa4021a4f86550aa5ae714763f69/flask_cache/__init__.py#L185-L192).

I was having a bit of trouble with my proxy initializations: I would create an app context during my app initialization phase, so I could get `my_bulbs.graph`, but when execution reached my views, the context had changed, including the `Graph`.

With this, state is tied to an app, instead of a context, and multiple apps are still supported.

Cheers