Skip to content

Commit

Permalink
Enable useServiceEffect to receive a Promisable service param (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
NielsJPeschel authored Mar 25, 2024
1 parent 0411ebc commit 57758ad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@optum/react-hooks",
"version": "1.0.0",
"version": "1.0.1-next.0",
"description": "A reusable set of React hooks",
"repository": "https://github.com/Optum/react-hooks",
"license": "Apache 2.0",
Expand Down

0 comments on commit 57758ad

Please sign in to comment.