using ref.keepAlive() vs @Riverpod(keepAlive: true) #3584
-
Hi everyone, I have a question about using I'm wondering if these two approaches achieve the same effect. Specifically, are they functionally equivalent? For example, consider the following implementation using class GuestRepository extends _$GuestRepository {
@override
Future<GuestMap?> build() async {
ref.keepAlive();
// Additional logic here
}
} And this implementation using the @Riverpod(keepAlive: true)
class GuestRepository extends _$GuestRepository {
@override
Future<GuestMap?> build() async {
// Additional logic here
}
} |
Beta Was this translation helpful? Give feedback.
Answered by
AhmedLSayed9
May 31, 2024
Replies: 1 comment
-
Yes, they should achieve the same effect. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
2kjm
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, they should achieve the same effect.