trackDerivation<T> method
Implementation
T? trackDerivation<T>(Derivation d, T Function() fn) {
final prevDerivation = _startTracking(d);
T? result;
if (config.disableErrorBoundaries == true) {
result = fn();
} else {
try {
result = fn();
d._errorValue = null;
} on Object catch (e, s) {
d._errorValue = MobXCaughtException(e, stackTrace: s);
}
}
_endTracking(d, prevDerivation);
return result;
}