This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun app(){ | |
createScreen { component, navigator-> | |
val presenter = component.loginPresenter() | |
loginScreen(presenter.viewState, | |
presenter.onSubmit, | |
presenter.onForgotPassword()) | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@DefineComponent(parent = ApplicationComponent::class) | |
internal interface UserComponent | |
@DefineComponent.Builder | |
internal interface UserComponentBuilder { | |
fun withUserId(@BindsInstance userId: Int): UserComponentBuilder | |
fun build(): UserComponent | |
} | |
@DefineComponent(parent = UserComponent::class) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MyMvrxViewModel<State, Rendering>(services:Services, userId:String, loadingVM: LoadingViewModel, dataVM:DataViewModel){ | |
sealed class State{ | |
object Loading():State | |
data class Data(value:String) | |
} | |
override fun render(context:RenderScope, state:State):{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Foo{ | |
fun doStuff() | |
companion object | |
} | |
fun Foo.Companion.CreateFoo():Foo = RealFoo() | |
private class RealFoo : Foo{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Foo{ | |
fun doStuff() | |
companion object | |
} | |
fun Foo.Companion.CreateFoo():Foo = RealFoo() | |
private class RealFoo : Foo{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Store<Article, Integer> store = StoreBuilder.<Integer, BufferedSource, Article>parsedWithKey() | |
.fetcher(articleId -> api.getArticles(articleId)) | |
.persister(FileSystemPersister.create(FileSystemFactory.create(context.getFilesDir()), pathResolver)) | |
.parser(GsonParserFactory.createSourceParser(gson, String.class)) | |
.open(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class State{ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val networkTrigger = Channel<Unit>(capacity = Channel.RENDEZVOUS) | |
val diskCommands = Channel<DiskCommand>(capacity = Channel.RENDEZVOUS) | |
launch { | |
// trigger first load | |
diskCommands.send(DiskCommand.ReadFirst) | |
} | |
val networkFlow = networkTrigger | |
.consumeAsFlow() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Mario(pipes:List<Pipeline>){ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Api { | |
@GET("r/{subredditName}/new/.json") | |
@RefershOnStale | |
@Persister | |
fun subRedditStore(@Path("subredditName") subredditName: String): RetroStore<RedditData> | |
} | |
fun getData() { |
NewerOlder