Closed justinbmeyer closed 8 years ago
computeStream.toStream(obj, ".fullName") //#2a
computeStream.toStream(obj, "fullName") //#3a
obj = {
get fullName() {
Observation.add(this, "first")
Observation.add(this,"last")
return this.first + " " + this.last;
}
}
Related to #2, but only focusing on the static API exported from this module.
toStream
use cases:#1
#2a
(or nested property#2b
) into an event stream#3a
(or nested observable event#3b
) into an event streamProposal 1 - reduced, common patterns API
Pros:
Cons:
.toStream(map, ".", "closed");
.toStream(compute)
.toStream( * , propName, [eventName])
.toCompute(stream)
Proposal 2 - closer to event stream expectations
Pros:
Cons:
.toStream(compute)
.toStream( * , eventName )
.toStream( * , propertyName, eventName )
Proposal 3 - spaces and dots
Pros:
Cons:
Alternate, force people to use
.
for property reads.Proposal 4 - To each his/her own
.toStreamFromCompute
.toStreamFromPropery(obs, propName )
.toStreamFromEvent(obs, event)
.toStreamFromEvent(obs, propName, event)