Closed neelz040 closed 4 years ago
Hello, yes, you are right. Thanks for telling. Going to fix that.
I could use an Observable for the path() of collections. I'm using multiple agents for one app and depending on which agent is active I need different sub-collections to be sync'ed.
What would be your recommendation to do so?
Not sure to understand what do you mean by agents. You could try with the path observable, (going to implement that in the next minor version) or you can work with routes. Meaning sync different collection with the CollectionGuard
@fritzschoff thx !! path observable will fix the 'workaround' I have now.
Agents in my case are parent collections which define a users roles etc.
@GrandSchtroumpf I saw you did some error handling if the path was an observable. Did you came to a conclusion that it would be a bad idea to have an observable?
Ah yes, the documentation is deprecated. I started with an observable path and it was a real pain to maintain and created a lot of unexpected side effects. I wouldn't recommend to support this. You usually want to use observable for subcollection, in this case it's better to create a helper method on syncCollection
with the right options.
You can find out documentation about subcollection here : https://github.com/dappsnation/akita-ng-fire/blob/v3.0.0/doc/cookbook/subcollection.md
okay, I will update the docs then
source: https://github.com/dappsnation/akita-ng-fire/blob/v3.0.0/doc/collection/service/config.md
It seems not possible for path() to return an Observable, only string !? Thx