Skip to content

Commit

Permalink
fix(common): fix local storage remove method
Browse files Browse the repository at this point in the history
  • Loading branch information
patryk-zielinski93 committed Jun 1, 2019
1 parent 012bbf1 commit 5103b2c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .huskyrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"pre-commit": "lint-staged",
"pre-push": "node -e \"console.log('Checking with prettier if files are correctly formatted. Errors will be listed below.')\" \
&& prettier libs/**/*.{json,css,scss,js,ts,html} --list-different \
&& npm run affected:lint -- --base=develop --head=HEAD"
&& npm run affected:lint -- --base=origin/master --head=HEAD"
}
}
6 changes: 3 additions & 3 deletions libs/common/src/lib/local-storage/src/local-storage-client.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EMPTY, Observable, of } from 'rxjs';
import { Observable, of } from 'rxjs';
import { EntityNotFoundError, NoEntityIdError } from './errors';

export class LocalStorageClient {
Expand Down Expand Up @@ -35,11 +35,11 @@ export class LocalStorageClient {
* @param {string} collection The name of the collection from which to remove the entity.
* @param {string | number} id Entity ID.
*/
static remove(collection: string, id: string | number): Observable<void> {
static remove(collection: string, id: string | number): Observable<null> {
const entities = LocalStorageClient.getCollection(collection);
LocalStorageClient.setCollection(collection, entities.filter(entity => entity.id !== id));

return EMPTY;
return of(null);
}

/**
Expand Down

0 comments on commit 5103b2c

Please sign in to comment.