Skip to content

Strange usage of ExecutorEffectsInterpreter in ExecutorEffectHandler #15

@adolgiy

Description

@adolgiy

Current implementation in 'master' looks like:

typealias ExecutorEffectsInterpreter<Eff, Msg> = ExecutorService.(eff: Eff, listener: (Msg) -> Unit) -> Unit

class ExecutorEffectHandler<Msg : Any, Eff : Any>(
    // ...
) : EffectHandler<Eff, Msg> {

    override fun handleEffect(eff: Eff) {
        effectsExecutorService.run { effectsInterpreter(eff, listener ?: {}) } // !!! THIS
    }
}

Line with comment do nothing except proxying call to extension function via run {} call. Shouldn't it be fixed like this?

effectsExecutorService.execute { effectsInterpreter(eff, listener ?: {}) }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions