updateData method

T? updateData(
  1. T? data, {
  2. bool useMicrotask = false,
})

Update current data in our Manager. Ignore if data is null. Use resetData instead if you want to reset to loading state

Implementation

T? updateData(T? data, {bool useMicrotask = false}) {
  if (_disposed) return null;
  if (data != null) {
    if (useMicrotask) {
      Future.microtask(() => value = value.addData(data));
    } else {
      value = value.addData(data);
    }
    _updateLastCacheDuration();
    return data;
  }
  return null;
}