Skip to content
Create a gist now

Instantly share code, notes, and snippets.

Embed URL


Subversion checkout URL

You can clone with
Download ZIP
A short dependency container for javascript / node applications
> var sb = new ServiceBox();
> sb.msg = "Hello World";
> var handler = sb.wrap(function (prefix) {
... console.log(prefix);
... console.log(this.msg);
... });
> handler("this is the prefix");
this is the prefix
Hello World
var ServiceBox = function () {
var self = this;
this.wrap = function (func) {
return function () {
return func.apply(self, arguments);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.