$set<R> method

  1. @mustCallSuper
T $set<R>(
  1. Symbol subID,
  2. R? value
)
inherited

Implementation

@mustCallSuper
T $set<R>(Symbol subID, R? value) {
  {
    final nc = _iniLock.remove(iD);
    if (!_immuneLock.remove(iD)) {
      if ($hasPrefix) {
        subID = $prefix.reduce((v, e) => v + e) + subID;
        _prefixes.update(iD, (v) => v..remove(_batchLock));
      }
    }
    value = nc ? (_args[iD]?[subID]) ?? value : value;
  }

  update() {
    _args.update(
      iD,
      (a) => a..[subID] = value,
      ifAbsent: () => {subID: value},
    );
    if ($isLocked) {
      _cache.update(
        iD,
        (a) => a..[subID] = value,
        ifAbsent: () => {subID: value},
      );
    }
    return this as T;
  }

  if (!_capLock.remove(iD)) return update();
  return this as T..$refresh(event: update);
}