Skip to content

StatefulRearchConsumer? #45

Closed Answered by GregoryConrad
busslina asked this question in Q&A
Discussion options

You must be logged in to vote

Seems that RearchConsumer is like a StatelessWidget compared to a StatefulWidget.

Well it is actually most comparable to StatefulWidget, but just abstracting the OOP away from you.

It hasn't lifecycle methods like initState or dispose.

That's right, they are abstracted away from you via side effects. You should use side effects when in a RearchConsumer.

initState and dispose are handled by use.callonce and use.effect.

deactivate is handled via a new registerFooBar on the WidgetSideEffectApi (so you will need to do a use.register() to add a deactivate listener).

There are other lifecycle methods, but I haven't bothered to add support for them yet since I haven't had a need to (and they…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by GregoryConrad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants