riverpod
riverpod copied to clipboard
Immediately call `ref.onCancel` after the initialization of a provider if it isn't currently listened
Currently, calling ref.read
on a provider that isn't listened yet (no ref.watch/listen) does not trigger ref.onCancel
.
Yet at the same time, that provider is considered to be paused, as it isn't currently in use.
This issue is about fixing the inconsistency, and invoking ref.onCancel
listeners if the provider is initialized but not listened