notify method
Called when any of the observed dependencies changes.
If a batch is currently active, queues this effect to run after the batch finishes. Otherwise, executes immediately.
Implementation
@override
void notify() {
if (isBatching) {
queueConsumer(this);
} else {
run();
}
}