Skip to content

Commit

Permalink
feat: 🎸 Made User properties optional for hook convenience (kolplattf…
Browse files Browse the repository at this point in the history
  • Loading branch information
JohanObrink authored Jan 4, 2021
1 parent d7e4981 commit 0e0e996
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions lib/fetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ export interface CallInfo extends RequestInit {
}

export interface FetcherOptions {
record?: (info: CallInfo, data: string | Blob | Buffer | ArrayBuffer) => Promise<void>
record?: (info: CallInfo, data: string | Blob | ArrayBuffer | any) => Promise<void>
}

export interface Fetcher {
(name: string, url: string, init?: RequestInit): Promise<Response>
}

export interface Recorder {
(info: CallInfo, data: string | Blob | Buffer | ArrayBuffer): Promise<void>
(info: CallInfo, data: string | Blob | ArrayBuffer | any): Promise<void>
}

const record = async (
Expand All @@ -28,7 +28,7 @@ const record = async (
type: string,
options: FetcherOptions,
response: Response,
data: string | Buffer | ArrayBuffer | Blob,
data: string | ArrayBuffer | Blob | any,
): Promise<void> => {
if (!options.record) {
return
Expand Down
12 changes: 6 additions & 6 deletions lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@ export interface MenuItem {
}

export interface User {
personalNumber: string
isAuthenticated: boolean
firstName: string
lastName: string
email: string | null
notificationId: string
personalNumber?: string
isAuthenticated?: boolean
firstName?: string
lastName?: string
email?: string | null
notificationId?: string
}

0 comments on commit 0e0e996

Please sign in to comment.