Skip to content

Instantly share code, notes, and snippets.

@JamesZoft
Last active May 29, 2019 11:06
Show Gist options
  • Save JamesZoft/74416c9763bfc70bfa93a087e886b233 to your computer and use it in GitHub Desktop.
Save JamesZoft/74416c9763bfc70bfa93a087e886b233 to your computer and use it in GitHub Desktop.
class Blah {
foo: null,
someModel: null,
constructor(args) {
someModel = args.someModel;
foo = new Foo({
"fn": a
});
this.barBaz.handleSomething = this.a.bind(this, this.someModel)
}
a: function(someModel, event) {
return function (event) {
someModel.baz(event);
}
}
}
class Foo {
constructor: function(args) {
this.someModel = args.someModel;
this.handleStuff = args.fn.bind(this, this.someModel)
}
}
// I want to pass a down the component tree twice to Foo's child so I can execute a. Foo's child will also have a someModel to execute on.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment