- No longer compatible with Firebase v8 namespaced ("compat") SDK
- Deprecated
CollectionGroupService
was removed QueryFn
was replaced withQueryConstraint[]
CollectionService.syncCollection()
now returnsObservable<DocumentChange<EntityType>[]>
instead ofObservable<DocumentChangeAction<EntityType>[]>
- Requires Firebase v9, Angular Fire v7, RxJS v7, Akita v7 and Angular v12+
Typescript version 4 and akita version 6 are now required.
With version 3.1.7, you need to update your firebase version >= 8 and your @angular/fire >= 6.0.4, firebase 8 now uses EMS instead of CommonJs.
With version v3, you need to update your akita version >=5.1.1, since there where breaking changes in the event-based-API from akita.
DEPRECATION:
syncManyDocs
won't support Observable argument anymore & will not cleanup previous ids when there is a change:
Use switchMap
& store.reset()
instead :
const ids = new BehaviorSubject(['1']);
// Don't
syncManyDocs(ids.asObservable()).subscribe();
// DO
ids
.asObservable()
.pipe(
tap((_) => this.store.reset()), // Remove old ids from the store before sync
switchMap((ids) => syncManyDocs(ids))
)
.subscribe();
CollectionGroupService
is deprecated. UseCollectionService
andsyncGroupCollection
articleService.syncGroupCollection('article').subscribe();
SubcollectionService
is removed. Use newsyncWithRouter
util method:
export class MovieService extends CollectionService<MovieState> {
constructor(store: MovieStore, protected routerQuery: RouterQuery) {
super(store);
}
sync = syncWithRouter.bind(this, this.routerQuery);
}
And in case your Collection path contains parameters, make sure to also override currentPath
getter:
@CollectionConfig({ path: 'organization/:id/movies' })
export class MovieService extends CollectionService<MovieState> {
constructor(store: MovieStore, protected routerQuery: RouterQuery) {
super(store);
}
sync = syncWithRouter.bind(this, this.routerQuery);
get currentPath() {
const { id } = this.routerQuery.getParams<string>();
if (!id) throw 'Path is not valid';
return this.getPath({ params: { id } });
}
}
Alternatively you can use CollectionService
and syncCollection({ params: { movieId }})
,
cause now you can provide a SyncOptions
value inside each sync
method
movieQuery
.selectActiveId()
.pipe(
switchMap((movieId) =>
stakeholderService.syncCollection({ params: { movieId } })
)
)
.subscribe();
Checkout the Cookbook for more details
[CollectionService].preFormat
is deprecated. UseformatToFirestore
instead ofpreFormat
We improve the semantic of the hook method to make it more understandable.
class MovieService extends CollectionService<MovieState> {
formatToFirestore(movie: Partial<Movie>): DBMovie {
return {
updatedOn: new Date(),
...movie,
};
}
}
-
[FireAuthService].user
is now aPromise
following@angular/[email protected]
. -
[FireAuthService].fireAuth
is a deprecated. User[FireAuthService].auth
instead.