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

feat(database): adds auditTime for queries #776

Merged
merged 4 commits into from
Feb 9, 2017

Conversation

cartant
Copy link
Contributor

@cartant cartant commented Jan 15, 2017

Checklist

Description

This PR adds an auditTime(0) operator to the composed query observable. That means the query is not emitted immediately, but is emitted in the event loop - so if there are changes made to multiple subjects, those changes don't result in the emission of multiple queries. See this comment.

I've made the auditing optional (it defaults to true) so that the observeQuery tests could remain synchronous and simple. The other tests now use auditing. And I've added some specific audit tests, too.

Also, this PR fixes a bug in which call was used instead of apply when composing the merge operator. Said operator takes a variable number of observables not an array, so apply should be used. (This also cleans up the calling function's result type - which was weird because the use of call sometimes saw observables emitted.)

The PR also changes test-root.ts to import rather than export, as I was unable to get Rollup to build a non-empty test bundle - even when using only the dependencies installed with AngularFire2.

RxJS merge takes a variable number of observables - not an array - so
apply should be called instead of call. Fixed the related test, too.
Not sure why this was commented out, as it's implemented and testable.
It's now tested in a manner similar to the other tests.
Using the export syntax, Rollup generates an empty bundle.
Adds an auditTime(0) operator to the composed query observable so that
changes made to multiple subjects are emitted as a single query (emitted
in the event loop) rather than as separate queries (emitted
immediately).

Closes angular#389 and angular#770.
@davideast
Copy link
Member

@cartant Thank you so much!

Let me give this a review and I'll get back to you soon!

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

Successfully merging this pull request may close these issues.

3 participants