get
observation.get()
Returns the value of the observation
.
import Observation from "can-observation";
import observe from "can-observe";
var person = observe({first: "Ramiya", last: "Meyer"});
var fullName = new Observation(function(){
return person.first + " " + person.last;
});
fullName.get() //-> "Ramiya Meyer";
If the observation is unbound, the observation's function will be run each time to get the value.
Once the observation is bound, its cached value will be returned. Its cached value will be updated when any of its dependencies change.
Returns
{Any}
:
Whatever the function returns.