update<T> static method

void update<T>(
  1. T t
)

Saves an object t of type T. If the object of the same type exists, it will be replaced.

Implementation

static void update<T>(T t) {
  assert(!('$T'.endsWith('?')), _nullTypeError);
  _hashStore.update(
    T.toString(),
    (_) => t as Object,
    ifAbsent: () => t as Object,
  );

  assert(() {
    postEvent('Mustang Store', {
      'persistentStoreName': _storeName,
      'persistentStoreLocation': _storeLocation,
      'persistentCacheStore': _cacheStoreName,
      'persistentCacheStoreLocation': _storeLocation,
      'objects': _hashStore.length,
    });
    return true;
  }());
}