11import { useEffect , useState } from 'react'
22import { Observable , BehaviorSubject , Subject , noop } from 'rxjs'
33
4- import { RestrictArray , VoidAsNull } from './type'
4+ import { RestrictArray , VoidAsNull , Not } from './type'
55
66export type EventCallbackState < EventValue , State , Inputs = void > = [
77 ( val : EventValue ) => void ,
@@ -12,13 +12,15 @@ export type ReturnedState<EventValue, State, Inputs> = [
1212 EventCallbackState < EventValue , State , Inputs > [ 1 ] [ 0 ]
1313]
1414
15- export type EventCallback < EventValue , State , Inputs > = Inputs extends void
16- ? ( eventSource$ : Observable < EventValue > , state$ : Observable < State > ) => Observable < State >
17- : (
18- eventSource$ : Observable < EventValue > ,
19- inputs$ : Observable < RestrictArray < Inputs > > ,
20- state$ : Observable < State > ,
21- ) => Observable < State >
15+ export type EventCallback < EventValue , State , Inputs > = Not <
16+ Inputs extends void ? true : false ,
17+ (
18+ eventSource$ : Observable < EventValue > ,
19+ inputs$ : Observable < RestrictArray < Inputs > > ,
20+ state$ : Observable < State > ,
21+ ) => Observable < State > ,
22+ ( eventSource$ : Observable < EventValue > , state$ : Observable < State > ) => Observable < State >
23+ >
2224
2325export function useEventCallback < EventValue > (
2426 callback : EventCallback < EventValue , void , void > ,
0 commit comments