Using functions as 'family' parameters correctly (operator==, hashCode) #651
Unanswered
wujek-srujek
asked this question in
Q&A
Replies: 1 comment
-
You could try making sure that you're reusing an existing function instance. So: provider(() => ...) is obviously a no-go. But you could store that Although I'd suggest finding a different approach. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Here https://riverpod.dev/docs/concepts/modifiers/family#parameter-restrictions it says that parameters need to implement
operator==
andhashCode
for 'family' to work. How would I do this correctly if I wanted a family which receives a callback as its parameter?I think inline lambdas or member methods, won't work, but global functions (or static ones) would - is this correct? I.e. I need to use the latter if I want 'family' to work correctly?
Beta Was this translation helpful? Give feedback.
All reactions