Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experimentations (possible v3.0) #21

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open

Conversation

RuiAAPeres
Copy link
Owner

@RuiAAPeres RuiAAPeres commented Jun 3, 2016

Intro

With version 2.0 for every resource we would access (via Reactor's fetch), it would be "loaded from" and "saved to" to the same place. This was due to how InDiskPersistence was created (with a persistencePath). Having a resource as input for the fetch, is wrong as well, because it implies that there is a different behaviour, depending on the resource, in terms of persistence. The correct way, would be to fix the resource when the Reactor is created.

Example

A ViewModel that accesses different sections: Sports, Fashion and World news. With 2.0 we would need a reactor for each section. With this new approach, we only need one instance.

Changes

From a code perspective:

  1. The InDiskPersistenceHandler, doesn't have any property now. It could actually be converted to free functions.
  2. The ReactorFlow is no longer responsible for deciding if persistence should be used or not.
  3. The Reactor methods, now have the responsibility to decide if it should be persisted and if so, what input they should receive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants