can.setKeyValue
Used by [can-reflect.settKeyValue can-reflect.setKeyValue] to set the stream's last emitted value or error. This symbol is only added to
emitterProperty objects.
emitterProperty[@@can.setKeyValue](key, value)
can-reflect.setKeyValue will use this function
to emit a value or error on the emitterProperty.
import Kefir from "can-kefir";
const age = Kefir.emitterProperty();
age.onValue( function( value ) {
console.log( value );
} );
canReflect.setKeyValue( age, "value", 30 ); // logs 30
Parameters
- name
{String}:Either
valueto emit value orerrorto emit errors. - value
{*}:Any value to emit.