carlw
01/07/2017, 1:20 PMcarlw
01/07/2017, 1:21 PMMVVM▾
carlw
01/07/2017, 1:21 PMcarlw
01/07/2017, 1:21 PMcarlw
01/07/2017, 1:22 PMcarlw
01/07/2017, 1:23 PMpermalmberg
01/07/2017, 1:24 PMcarlw
01/07/2017, 1:25 PMcarlw
01/07/2017, 1:25 PMjchildress
01/07/2017, 1:36 PMcarlw
01/07/2017, 1:39 PMcarlw
01/07/2017, 1:40 PMcarlw
01/07/2017, 1:50 PMcarlw
01/07/2017, 1:52 PMgtnarg
01/07/2017, 1:57 PMcarlw
01/07/2017, 1:58 PMgtnarg
01/07/2017, 2:00 PMcarlw
01/07/2017, 2:01 PMedvin
01/07/2017, 2:09 PMedvin
01/07/2017, 2:10 PMedvin
01/07/2017, 2:13 PMpermalmberg
01/07/2017, 3:28 PMedvin
01/07/2017, 5:09 PMrunAsync
and then release. There are two issues with runAsync
right now. One is that you have no access to the Task
instance while it runs, the other is a timing issue that nobody will probably ever notice (except for @Ruckus, who already knows). I'm unsure if we can make this without breaking the API, or introduce an alternative to runAsync
.edvin
01/07/2017, 5:11 PMTask
can be done within the current structure, but it would mean that this
is Task<*>
. If you try to access valueProperty
, it would be Any
instead of T
. To solve that, I think runAsync
would need to take a type parameter, and that sucks. Nobody wants to write runAsync<Customer> { loadCustomer() }
.edvin
01/07/2017, 5:23 PMfun <T> runAsync(func: () -> T) = task(func)
- then we don't need to supply a type argument, the compiler can infer T
from the value func
returns. However, if func
operates` on something of type T
, it suddenly requires that type parameter. Changing to fun <T> runAsync(func: Task<T>.() -> T) = task(func)
is what I want to do.carlw
01/07/2017, 5:25 PMedvin
01/07/2017, 5:26 PMTask
.carlw
01/07/2017, 5:27 PMcarlw
01/07/2017, 5:27 PMcarlw
01/07/2017, 5:28 PM