uber / uber/RIBs

[Question] Exposing rx subjects from presenter to Interactor ?

Open
#338 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

iOS
Dominant language
Kotlin
Stars
7.9k
Forks
914
PR merge metrics
No merged PRs in 30d

Description

I was thinking whether there is any draw back in exposing rx subjects from the presenter to the Interactor. Taking an example of loading all employees in a tableview

Presenter:

protocol EmployeeListPresentable: Presentable {
	 var empSubject: PublishSubject<[Employee]>{ get set} // Exposing rx subject
}

Interactor:
//Assuming here employees is an array of Employee objects
self.presenter.empSubject.onNext(employees)

This is more convenient at times compared to calling a function. for eg:

protocol EmployeeListPresentable: Presentable {
	 func updateEmployeeList(_ employees:[Employee])
}

as the subj is already bound to UI and reloading takes place automatically.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no repository files, tests, or entry points to inspect. Start by locating the presenter and interactor contracts for the employee-list example and review existing RIBs guidance on presenter-to-interactor boundaries. Done would require an agreed architectural direction, with its trade-offs documented and an identified implementation scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
mobile-dev
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.