Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Conversation

jamestalmage
Copy link
Contributor

I find myself wanting more control over how things get batched in angularFire.
This introduces a batchingFactory config option that allows substitution of the default implementation.
Going forward I see adding finer grained control by allowing different strategies for $save,$update, etc.

A common use would be blocking/canceling pending updates from the server if there is a local change pending.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling c51e6be on jamestalmage:custom-batching into * on firebase:master*.

@katowulf
Copy link
Contributor

katowulf commented Dec 1, 2014

We've talked about pause/resume type functionality before. This is an interesting concept and probably not too hard to implement. My primary hesitation has been that it's a complex feature and would likely be abused and confused by users who are not extremely well versed in Angular and async behaviors.

It also seems like much of this functionality could be obtained by overriding $$process or the specific $$added et al. Let me ponder and chat with @jwngr about this.

@jamestalmage
Copy link
Contributor Author

My concern with $$process, $$added, etc, is that batching is a cross-cutting concern that will likely apply across multiple object types, so implementing there is going to lend itself to repetitive code. Also, it would force users to deal with batching just to override those methods (and as you've said, that is asking a bit much of users who are just starting out with angularFire).

@jamestalmage
Copy link
Contributor Author

This way allows users to leverage a sensible default batching mechanism we provide, and override it if they need to. We could also provide a simple option to disable batching altogether.

@katowulf
Copy link
Contributor

katowulf commented Dec 1, 2014

To clarify, I feel like pause/resume and batching are different concepts, and my comments above would only apply if we replaced our batching with the $evalAsync approach.

@katowulf
Copy link
Contributor

After we release 0.9.1, I'm going to investigate $evalAsync and probably remove batching.

@jwngr
Copy link

jwngr commented Jan 30, 2015

Closing this PR in favor of #411.

@jwngr jwngr closed this Jan 30, 2015
@jamestalmage jamestalmage deleted the custom-batching branch January 30, 2015 23:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants