uber / uber/RIBs-iOS

[Question] Exposing rx subjects from presenter to Interactor ?

Open
#31 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Swift
Stars
193
Forks
23
PR merge metrics
No merged PRs in 30d

Description

Original issue: https://github.com/uber/RIBs/issues/338

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

Start by reading the linked original issue and the Swift presenter/interactor examples in this report. Determine whether exposing a PublishSubject is intended to be supported and document the resulting guidance or decision; the issue is done when the design question has a clear, accepted answer.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.