Skip to content

Instantly share code, notes, and snippets.

@yreynhout
Created August 4, 2012 11:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yreynhout/3256733 to your computer and use it in GitHub Desktop.
Save yreynhout/3256733 to your computer and use it in GitHub Desktop.
Viewmodels - Building blocks
var Trigger = function () {
if (!this instanceof Trigger) {
return new Trigger();
}
var self = PausableSubscriberExtension(
DisposableExtension(
FocusExtension(
EnableExtension(
VisibleExtension(
this))))),
triggerCallback;
self.Command = function () {
triggerCallback();
};
self.setCallback = function (callback) {
triggerCallback = callback;
};
return self;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment