Skip to content

Instantly share code, notes, and snippets.

@alexeyraspopov
Created June 21, 2014 11:01
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 alexeyraspopov/b93bd6bd0e9573dc9b5f to your computer and use it in GitHub Desktop.
Save alexeyraspopov/b93bd6bd0e9573dc9b5f to your computer and use it in GitHub Desktop.
function SomeViewModel(title){
this.title = data(title)
.map(toLowerCase);
this.description = event(node, 'change')
.map(getTargetValue)
.filter(Boolean);
this.full = computed(interpolate('$0: $1'), [this.title, this.description]);
}
function SomeViewModel(title){
this.title = data(title)
.bind(map(toLowerCase));
this.description = event(node, 'change')
.bind(map(getTargetValue))
.bind(filter(Boolean));
this.full = computed(interpolate('$0: $1'), [this.title, this.description]);
}
function SomeViewModel(title){
this.title = data(title)
.bind(toLowerCase());
this.description = event(node, 'change')
.bind(getTargetValue())
.bind(isDefined());
this.full = computed(interpolate('$0: $1'), [this.title, this.description]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment