You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the callback reference is updated, the hook should _unsubscribe() and _subscribe() again to update the callback reference; or use some kind of callback wrapper to always provide the latest callback reference (doesn't work).
I can also provide the PR if this behavior is indeed a bug.
The text was updated successfully, but these errors were encountered:
Describe the bug
When the callback reference is updated, the
useOnStreamChange
hook doesn't update.Cause:
flutter_hooks/packages/flutter_hooks/lib/src/async.dart
Lines 396 to 397 in 319679b
The hook implementation only check for changes of
stream
andcancelOnError
parameters, other callback parameters are ignored.To Reproduce
Reproducible sample: https://dartpad.dev/?id=cdc8f5006a2e15f0761504cba0ab81cb
Expected behavior
When the callback reference is updated, the hook should
_unsubscribe()
and_subscribe()
again to update the callback reference;or use some kind of callback wrapper to always provide the latest callback reference(doesn't work).I can also provide the PR if this behavior is indeed a bug.
The text was updated successfully, but these errors were encountered: