File tree Expand file tree Collapse file tree 9 files changed +32
-1
lines changed Expand file tree Collapse file tree 9 files changed +32
-1
lines changed Original file line number Diff line number Diff line change 1+ export function complete < T > ( onSuccess ?: ( data : T ) => void , onError ?: ( error : unknown ) => void ) {
2+ return ( err ?: unknown , res ?: T ) => {
3+ if ( err ) {
4+ onError ?.( err ) ;
5+ } else if ( res ) {
6+ onSuccess ?.( res ) ;
7+ }
8+ } ;
9+ }
Original file line number Diff line number Diff line change 1+ export * from './complete' ;
Original file line number Diff line number Diff line change 1+ export function error < T > ( onError ?: ( error : unknown ) => void ) {
2+ /* eslint-disable @typescript-eslint/no-unused-vars */
3+ return ( err ?: unknown , res ?: T ) => {
4+ if ( err ) {
5+ onError ?.( err ) ;
6+ }
7+ } ;
8+ }
Original file line number Diff line number Diff line change 1+ export * from './error' ;
Original file line number Diff line number Diff line change 1+ export * from './complete' ;
2+ export * from './error' ;
3+ export * from './success' ;
Original file line number Diff line number Diff line change 1+ export * from './success' ;
Original file line number Diff line number Diff line change 1+ export function success < T > ( onSuccess ?: ( data : T ) => void ) {
2+ return ( err ?: unknown , res ?: T ) => {
3+ if ( res ) {
4+ onSuccess ?.( res ) ;
5+ }
6+ } ;
7+ }
Original file line number Diff line number Diff line change 11export * from './useLoadData' ;
22export * from './types' ;
3+ export * from './callbacks' ;
Original file line number Diff line number Diff line change 11{
22 "name" : " @optum/react-hooks" ,
3- "version" : " 1.0.2 " ,
3+ "version" : " 1.0.3 " ,
44 "description" : " A reusable set of React hooks" ,
55 "repository" : " https://github.com/Optum/react-hooks" ,
66 "license" : " Apache 2.0" ,
You can’t perform that action at this time.
0 commit comments