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

ValueObservation: delayed reducer creation #446

Merged
merged 4 commits into from
Nov 25, 2018

Conversation

groue
Copy link
Owner

@groue groue commented Nov 25, 2018

This PR fixes an issue with ValueObservation.

The most low-level ValueObservation creation method used to be:

ValueObservation.tracking(...: reducer: Reducer)

It is now:

ValueObservation.tracking(...: reducer: @escaping (Database) -> Reducer)

This fixes two problems:

  • It used to be painful to perform initial configuration of the reducer with a database connection.
  • The reducing process starts when the observation is started: starting an observation several times should thus create as many reducers.

This PR replaces the old method with the new one, without deprecation: this is a breaking change. This should be OK since value reducers are an advanced and low-level feature, and ValueObservation is still very young. This breaking change has been removed in #454.

@groue groue merged commit 550c016 into development Nov 25, 2018
@groue groue deleted the feature/ValueReducerFactory branch November 25, 2018 17:33
@groue groue added this to the GRDB 3.6.0 milestone Dec 1, 2018
groue added a commit that referenced this pull request Dec 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant