createProperty feature specification
This is the engineering specification for the createProperty
API.
Overview
createProperty(withInitialValue:)
creates an anonymous ReactiveProperty with a given initial
value.
For languages that don’t allow top-level functions,
ReactiveProperty.of()
is the preferred API signature.
let someProperty = createProperty(withInitialValue: 20)
ReactiveProperty<Float> property = ReactiveProperty.of(100f);
MVP
Expose a createProperty API
It should be genericized on type T.
public func createProperty<T>(withInitialValue initialValue: T) -> ReactiveProperty<T>
public static <T> ReactiveProperty<T> of(T initialValue)
Return a ReactiveProperty instance
func createProperty<T>(withInitialValue value: T) -> ReactiveProperty<T> {
return ReactiveProperty(withInitialValue: value)
}
public static <T> ReactiveProperty<T> of(T initialValue) {
return new ValueReactiveProperty<>(initialValue);
}