getterSetter
The getterSetter argument passed to registerConverter.
Object
An object with a get and set method that get converted to a two-way helper.
stache.registerConverter( "numberToString", {
get: function( fooCompute ) {
return "" + fooCompute();
},
set: function( newVal, fooCompute ) {
fooCompute( +newVal );
}
} );
A getterSetter object provides:
- A
getmethod that returns the value of theleftvalue given the arguments passed on theright. - a
setmethod that updates one or multiple of therightarguments computes given a newleftvalue.