Add a public non-factory constructor for Property
danschultz opened this issue · comments
Dan Schultz commented
It's not possible to sub-class Property from a non frappe
library.
class Property<T> extends Reactable<T> {
Property._(Stream<T> stream, bool hasInitialValue, [T initialValue]) {
...
}
Property(Stream<T> stream) => this._(stream, false);
Property.withInitialValue(T initialValue, Stream<T> stream) => this._(stream, true, initialValue);
}
Deprecate factory constructors for Property.fromStream()
and Property.fromStreamWithInitialValue()
.
Alex Bush commented
👍 for the feature and the discussion you guys had #40
@danschultz I'm thinking about sending a pr. do you have a guideline I should follow?
Dan Schultz commented
@alexvbush, my plan was to add two new non-factory constructors Property(Stream<T> stream)
and Property.withInitialValue(T initialValue, Stream<T> stream)
. This API is more inline with how the EventStream
's constructor works.
Thanks for considering making a contribution. It's much appreciated!