Skip to content

Commit

Permalink
Enable useServiceEffect to receive a _Promisable_ service param
Browse files Browse the repository at this point in the history
  • Loading branch information
NielsJPeschel authored Mar 25, 2024
1 parent 0411ebc commit 10621d7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hooks/useServiceEffect/useServiceEffect.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import {useEffect} from 'react';
import {Promisable} from '../../types';

export function useServiceEffect<T>(
isPending: boolean,
service: () => Promise<T>,
service: () => Promisable<T>,
onServiceCallResolved?: (response: T) => void,
onServiceCallRejected?: (error: unknown) => void,
onInitiateServiceCall?: () => void,
Expand Down

0 comments on commit 10621d7

Please sign in to comment.