Skip to content

Commit

Permalink
fix(storage): allow generic return types
Browse files Browse the repository at this point in the history
  • Loading branch information
pascaliske committed Apr 16, 2023
1 parent fd939e1 commit d5706bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/shared/storage/storage.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ export class StorageService {

public constructor(private readonly browserApiService: BrowserApiService) {}

public get(key: string): string | null {
public get<T = string>(key: string): T | null {
return this.browserApiService.with('localStorage', localStorage => {
return localStorage.getItem(`${this.prefix}${key}`)
return localStorage.getItem(`${this.prefix}${key}`) as T
})
}

Expand Down

0 comments on commit d5706bb

Please sign in to comment.