Skip to content

Commit 0280f40

Browse files
authored
refactor(useNotifications): add types to callbacks (#960)
1 parent 71d9799 commit 0280f40

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/hooks/useNotifications.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ export const useNotifications = (colors: boolean): NotificationsState => {
203203
);
204204

205205
const markNotificationRead = useCallback(
206-
async (accounts, id, hostname) => {
206+
async (accounts: AuthState, id: string, hostname: string) => {
207207
setIsFetching(true);
208208

209209
const isEnterprise = isEnterpriseHost(hostname);
@@ -236,7 +236,7 @@ export const useNotifications = (colors: boolean): NotificationsState => {
236236
);
237237

238238
const markNotificationDone = useCallback(
239-
async (accounts, id, hostname) => {
239+
async (accounts: AuthState, id: string, hostname: string) => {
240240
setIsFetching(true);
241241

242242
const isEnterprise = isEnterpriseHost(hostname);
@@ -269,7 +269,7 @@ export const useNotifications = (colors: boolean): NotificationsState => {
269269
);
270270

271271
const unsubscribeNotification = useCallback(
272-
async (accounts, id, hostname) => {
272+
async (accounts: AuthState, id: string, hostname: string) => {
273273
setIsFetching(true);
274274

275275
const isEnterprise = isEnterpriseHost(hostname);
@@ -295,7 +295,7 @@ export const useNotifications = (colors: boolean): NotificationsState => {
295295
);
296296

297297
const markRepoNotifications = useCallback(
298-
async (accounts, repoSlug, hostname) => {
298+
async (accounts: AuthState, repoSlug: string, hostname: string) => {
299299
setIsFetching(true);
300300

301301
const isEnterprise = isEnterpriseHost(hostname);
@@ -328,7 +328,7 @@ export const useNotifications = (colors: boolean): NotificationsState => {
328328
);
329329

330330
const markRepoNotificationsDone = useCallback(
331-
async (accounts, repoSlug, hostname) => {
331+
async (accounts: AuthState, repoSlug: string, hostname: string) => {
332332
setIsFetching(true);
333333

334334
try {
@@ -371,7 +371,7 @@ export const useNotifications = (colors: boolean): NotificationsState => {
371371
);
372372

373373
const removeNotificationFromState = useCallback(
374-
(id, hostname) => {
374+
(id: string, hostname: string) => {
375375
const updatedNotifications = removeNotification(
376376
id,
377377
notifications,

0 commit comments

Comments
 (0)