Skip to content

Instantly share code, notes, and snippets.

@ericntd
Last active September 9, 2021 17:36
Show Gist options
  • Save ericntd/69c5e0a5fb80cd7621c839809ff54d62 to your computer and use it in GitHub Desktop.
Save ericntd/69c5e0a5fb80cd7621c839809ff54d62 to your computer and use it in GitHub Desktop.
Upscoped click subject in a feature view module
@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