hydrated
hydrated copied to clipboard
why hydrate take time and have to use Future.delay()
Hi @jahir9991, could you please provide a code sample?
Hi @solid-software For example, I have a subject like that:
final _connect = HydratedSubject<bool>("_connect", seedValue: false);
And it already has true value, then on the application start (from the main(), for example) I do like that:
print("start ${_connect.value}");
await Future.delayed(const Duration(milliseconds: 100)); // To wake Hydrated
print("start ${_connect.value}");
Console log would be:
false
true
If there is no seed value subject will throw an exception.