feat(database): adds auditTime for queries #776
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Checklist
npm install
,npm run build
, andnpm test
run successfully? yesDescription
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 theobserveQuery
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 ofapply
when composing themerge
operator. Said operator takes a variable number of observables not an array, soapply
should be used. (This also cleans up the calling function's result type - which was weird because the use ofcall
sometimes saw observables emitted.)The PR also changes
test-root.ts
toimport
rather thanexport
, as I was unable to get Rollup to build a non-empty test bundle - even when using only the dependencies installed with AngularFire2.