Open m-mujica opened 6 years ago
Alternative interface suggested by @justinbmeyer
{ toStreamFromValue: function(source){ Kefir.stream(function(emitter){ Reflect.onValue(source, function(value){ emitter.value(value) }) emitter.value(Reflect.getValue(source)) }); }, toStreamFromValueAndErrorKeys: function(source){ Kefir.stream(function(emitter){ Reflect.onKeyValue(source, "value",function(value){ emitter.value(value) },"notify") Reflect.onKeyValue(source, "error",function(value){ emitter.error(value) },"notify") emitter.value(Reflect.getKeyValue(source,"value")) }); }, toReflectedValue: function() { {can.getValue, can.onValue} } }
Alternative interface suggested by @justinbmeyer