Created
November 30, 2012 12:16
-
-
Save wolfflow/4175451 to your computer and use it in GitHub Desktop.
Extending rx.jquery bindings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UserEvents = {foo:"foo", bar:"bar"} | |
for key, value of UserEvents | |
$.fn[key+"AsObservable"] = (eventData) -> | |
@bindAsObservable value, eventData |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var UserEvents, key, value; | |
UserEvents = { | |
foo: "foo", | |
bar: "bar" | |
}; | |
for (key in UserEvents) { | |
value = UserEvents[key]; | |
$.fn[key + "AsObservable"] = function(eventData) { | |
return this.bindAsObservable(value, eventData); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment