onDispose method
Add a cleanup function to be called when the signal is disposed
final counter = signal(0);
final effectCount = signal(0);
final cleanup = counter.onDispose(() {
print('Counter has been disposed');
});
// Remove the cleanup function
cleanup();
Implementation
@override
EffectCleanup onDispose(void Function() cleanup) {
return instance.onDispose(cleanup);
}