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

Cache index keys in $indexFor #460

Closed
wants to merge 4 commits into from
Closed

Cache index keys in $indexFor #460

wants to merge 4 commits into from

Conversation

katowulf
Copy link
Contributor

@jwngr important because we now call $indexFor 2-5 times for each add/update event.

src/FirebaseArray.js
 - _notify renamed to $$notify
 - _process renamed to $$process
 - $$process no longer called internally by $$added/$$updated/$$moved/$$removed
 - $$added now returns a record
 - $$updated now returns a boolean indicating whether anything changed
 - $$moved now returns a boolean indicating whether record should be moved
 - $$removed now returns a boolean indicating whether record should be removed
src/firebase.js: SyncArray to support new $$process usage
 - $$process now called after $$added, $$updated, $$removed, and $$moved (instead of coupled to those methods)
 - $$updated, $$moved, and $$removed only called if rec exists in the array
test/jasmineMatchers.js: added toHaveCallCount(), toBeEmpty(), and toHaveLength()
src/FirebaseArray.js: added a cache of record indices
test/unit/firebase.spec.js: Fix broken test case
test/mocks/mock.utils.js: unused parameter
@katowulf
Copy link
Contributor Author

unmunging...

@katowulf katowulf closed this Nov 14, 2014
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 75a3f96 on kato-indexfor into * on master*.

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.

None yet

2 participants