-
Notifications
You must be signed in to change notification settings - Fork 85
why useEventCallback's inputs$ and states$ opposite to their input argument order #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I am a bit confused. https://github.com/LeetCode-OpenSource/rxjs-hooks/blame/master/README.md#L338 https://github.com/LeetCode-OpenSource/rxjs-hooks/blame/master/README.md#L217 These two signatures are not the same right? |
Oh I see. It is reversed in https://github.com/LeetCode-OpenSource/rxjs-hooks/blame/master/README.md#L203-L207 |
But if I write something like this the const [onChange] = useEventCallback(
(event$: Observable<React.MouseEvent<HTMLDivElement>>, $input) =>
event$.pipe(
map(e => e.type === 'mouseenter'),
debounceTime(300),
withLatestFrom($input),
tap(([type , [onChange]]) => onChange(type))
),
false,
[props.onChange]
) |
@Brooooooklyn I would like to PR this, however it would be a breaking change as the order should be reversed for each call that uses the 3 observables Edit: Add PR link |
Fixed in #115 |
I thinks x to be
0
and y to befalse
is expected, butuseEventCallback
give opposite result. Am I doing something wrong.versions info:
rxjs-hooks: 0.4.3
The text was updated successfully, but these errors were encountered: