Last active
September 9, 2021 17:36
-
-
Save ericntd/69c5e0a5fb80cd7621c839809ff54d62 to your computer and use it in GitHub Desktop.
Upscoped click subject in a feature view module
This file contains hidden or 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
@Module | |
class SomeFeatureViewModule() { | |
@Provides | |
fun clickSubject() = PublishSubject.create<Unit>() | |
@Provides | |
fun clickReadStream(clickSubject: PublishSubject<Unit>): Observable<Unit> = subject.throttleFirst(500L, TimeUnit.MILLISECONDS) | |
@Provides | |
fun viewModelFactory() = SomeViewModelFactory(clickReadStream: Observable<Unit>) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment