zak.taccardi
03/24/2017, 4:24 PMzak.taccardi
03/24/2017, 4:24 PMzak.taccardi
03/24/2017, 4:25 PMfun observeShuffles(): Observable<ShuffleOperation>
sealed class ShuffleOperation {
//when deck is in the process of being shuffled
object Shuffling : ShuffleOperation()
//an error happened when shuffling the deck
class Error(val description: String) : ShuffleOperation()
//successfully shuffled deck
class Shuffled(val deck: Deck) : ShuffleOperation()
}
rednifre
03/24/2017, 4:28 PMsealed class Option<A> {
class Some(val value: A): Option<A>
object None(): Option<A>
}
zak.taccardi
03/24/2017, 4:29 PMzak.taccardi
03/24/2017, 4:30 PMzak.taccardi
03/24/2017, 4:31 PMzak.taccardi
03/24/2017, 4:31 PMrednifre
03/24/2017, 4:31 PMrednifre
03/24/2017, 4:32 PMzak.taccardi
03/24/2017, 4:33 PMzak.taccardi
03/24/2017, 4:33 PMrednifre
03/24/2017, 4:34 PMzak.taccardi
03/24/2017, 4:35 PMzak.taccardi
03/24/2017, 4:38 PMzak.taccardi
03/24/2017, 4:41 PMsealed class User {
class LoggedIn(....) : User(),
object NotLoggedIn : User()
}
zak.taccardi
03/24/2017, 4:42 PMthomasnield
03/25/2017, 3:18 AMsdeleuze
03/27/2017, 1:07 PMreactor-kotlin-extensions
since I will shortly release 1.0.0.M1
. Feel free to test, creates issues or submit PR. https://github.com/reactor/reactor-kotlin-extensionsmutexkid
03/27/2017, 5:47 PMmutexkid
03/27/2017, 5:47 PMmutexkid
03/27/2017, 5:48 PMmutexkid
03/27/2017, 5:53 PMjames.cruz
03/28/2017, 4:33 AMprivate fun applySchedulers() = this.subscribeOn(…)...
but personally, I prefer to explicitly declare the types if the field or function is public.
As for the type parameter declaration <T>
, you may want to set it to <T : Any>
instead to ensure it only accepts and returns non-nullable typesjohnl
03/28/2017, 9:17 AMreggar
03/28/2017, 9:18 AMreggar
03/28/2017, 9:18 AMjohnl
03/28/2017, 9:18 AMjohnl
03/28/2017, 9:18 AMjohnl
03/28/2017, 9:18 AM