Rename apply
to withDefault
This commit is contained in:
parent
8df96ed076
commit
ef1216a821
@ -27,7 +27,7 @@ object FutureObservable {
|
|||||||
* no equivalent mechanism for this mandatory functionality, but recovery
|
* no equivalent mechanism for this mandatory functionality, but recovery
|
||||||
* is already a built-in feature.
|
* is already a built-in feature.
|
||||||
*/
|
*/
|
||||||
def apply[A](defaultValue: A)(future: Future[A])(implicit ec: ExecutionContext): ReadOnlyObjectProperty[A] = {
|
def withDefault[A](defaultValue: A)(future: Future[A])(implicit ec: ExecutionContext): ReadOnlyObjectProperty[A] = {
|
||||||
future.value match {
|
future.value match {
|
||||||
case Some(Success(a)) =>
|
case Some(Success(a)) =>
|
||||||
ObjectProperty(a)
|
ObjectProperty(a)
|
||||||
@ -50,6 +50,9 @@ object FutureObservable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@deprecated("Use withDefault. `Apply` will be either removed or repurposed in a future release.", "0.10.2")
|
||||||
|
def apply[A](defaultValue: A)(future: Future[A])(implicit ec: ExecutionContext) = withDefault(defaultValue)(future)
|
||||||
|
|
||||||
/** Construct an observable that gives `None` until the `Future` completes successfully, after
|
/** Construct an observable that gives `None` until the `Future` completes successfully, after
|
||||||
* which the `Option` contains the successful result.
|
* which the `Option` contains the successful result.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user