onDispose abstract method

void onDispose(
  1. void cb()
)

Register an cb function, that is called when the atom is invalidated or disposed.

Can be called multiple times.

Implementation

void onDispose(void Function() cb);