Skip to content

Commit

Permalink
prettier-all-the-things-redux
Browse files Browse the repository at this point in the history
  • Loading branch information
randallmeeker authored and GrandSchtroumpf committed Sep 26, 2021
1 parent c846b74 commit 319b9ce
Show file tree
Hide file tree
Showing 59 changed files with 1,290 additions and 699 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"name": "Launch Chrome against localhost",
"url": "http://localhost:4200",
"webRoot": "${workspaceFolder}"
}
}
]
}
37 changes: 26 additions & 11 deletions BREAKING_CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
# Breaking Changes & Deprecations

## 5.0.0

Typescript version 4 and akita version 6 are no required.

## 3.1.7

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.

## 3.0.0

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.
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.

## 2.0.0

**DEPRECATION**:

- `syncManyDocs` won't support Observable argument anymore & will not cleanup previous ids when there is a change:

Use `switchMap` & `store.reset()` instead :
Expand All @@ -22,19 +25,23 @@ 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();
ids
.asObservable()
.pipe(
tap((_) => this.store.reset()), // Remove old ids from the store before sync
switchMap((ids) => syncManyDocs(ids))
)
.subscribe();
```

- `CollectionGroupService` is deprecated. Use `CollectionService` and `syncGroupCollection`

```typescript
articleService.syncGroupCollection('article').subscribe()
articleService.syncGroupCollection('article').subscribe();
```

- `SubcollectionService` is **removed**. Use new `syncWithRouter` util method:

```typescript
export class MovieService extends CollectionService<MovieState> {
constructor(store: MovieStore, protected routerQuery: RouterQuery) {
Expand All @@ -45,6 +52,7 @@ export class MovieService extends CollectionService<MovieState> {
```

And in case your Collection path contains parameters, make sure to also override `currentPath` getter:

```typescript
@CollectionConfig({ path: 'organization/:id/movies' })
export class MovieService extends CollectionService<MovieState> {
Expand All @@ -63,24 +71,31 @@ export class MovieService extends CollectionService<MovieState> {

Alternatively you can use `CollectionService` and `syncCollection({ params: { movieId }})`,
cause now you can provide a `SyncOptions` value inside each `sync` method

```typescript
movieQuery.selectActiveId().pipe(
switchMap(movieId => stakeholderService.syncCollection({ params: { movieId }}))
).subscribe()
movieQuery
.selectActiveId()
.pipe(
switchMap((movieId) =>
stakeholderService.syncCollection({ params: { movieId } })
)
)
.subscribe();
```

> Checkout the [Cookbook](./doc/cookbook/subcollection.md) for more details
- `[CollectionService].preFormat` is deprecated. Use `formatToFirestore` instead of `preFormat`

We improve the semantic of the hook method to make it more understandable.

```typescript
class MovieService extends CollectionService<MovieState> {
formatToFirestore(movie: Partial<Movie>): DBMovie {
return {
updatedOn: new Date(),
...movie
}
...movie,
};
}
}
```
Expand Down
23 changes: 21 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,62 +1,81 @@
# Change Log

## 6.0.0

Supporting Angular 12.

## 5.0.2

Fixed typing in syncWithRouter function. Thanks to @randallmeeker for the bug report.

## 5.0.1

CollectionService exposes `createId` function from AngularFire.

## 4.3.3

Add `useMemorization` on `CollectionService` to support multicasting.

## 4.3.1

Added `await` in the update callback function.

## 4.3

Created a second entry point for the `real time database service` => `akita-ng-fire/rtdb`

## 4.0.1

Thanks to @randallmeeker for reporting a bug on how we reset the store.

## 4.0.0

Update peerDependencies firebase to version >= 8 and @angular/fire to version >= 6.0.4, firebase 8 now uses EMS instead of CommonJs.
Thanks to @avelow
Thanks to @avelow

### 3.1.6

Removed export from public api

### 3.1.5

Removed if statement in `upsert` method. It was causing an issue when we provide an object with the id of the document.
`service.upsert({ id, ...updates })`

### 3.1.4

Fixed wrong hook call in auth service.

### 3.1.3

Fixed scope issue in signin function.

### 3.1.2

If signin is working with a not new user, we update the store from the corresponding document from firestore.

### 3.1.1

Fixed issue with profile object getting updated in the signin method from the auth service.

### 3.1.0
The auth store gets now updated properly when a user signs in after he signed up.

The auth store gets now updated properly when a user signs in after he signed up.
Also the function `fireAuth` that was deprecated for a long time has been removed.

### 3.0.5

Bug fix for `getValue`. Now the idKey is merged into the value object. Thanks to @randallmeeker for the bug report.

### 3.0.4

`callFunction` is now part of the public API. Thanks to @wSedlacek

### 3.0.3

Bug fix from @TimVanMourik . Entity stores didn't get properly updated.

### 3.0.2

Added `resetOnUpdate` config to `CollectionService`. With this config you can choose whether you totally want to remove and entity and add a new one with the new state,
or, and this is default, when set to false, you let akita handle how they update their stores by design. Meaning if your new state updating the store, the keys that maybe got removed in the new state are still present in the akita store. So if you want the new state to be the only source of truth, set this config to true.
18 changes: 4 additions & 14 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"assets": ["src/favicon.ico", "src/assets"],
"styles": [
"./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
"src/styles.scss"
Expand Down Expand Up @@ -91,10 +88,7 @@
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"assets": [
"src/favicon.ico",
"src/assets"
],
"assets": ["src/favicon.ico", "src/assets"],
"styles": [
"./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
"src/styles.scss"
Expand All @@ -110,9 +104,7 @@
"tsconfig.spec.json",
"e2e/tsconfig.json"
],
"exclude": [
"**/node_modules/**"
]
"exclude": ["**/node_modules/**"]
}
},
"e2e": {
Expand Down Expand Up @@ -162,9 +154,7 @@
"projects/akita-ng-fire/tsconfig.lib.json",
"projects/akita-ng-fire/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
"exclude": ["**/node_modules/**"]
}
}
}
Expand Down
Loading

0 comments on commit 319b9ce

Please sign in to comment.