newGenericVault<V, T extends Store<VaultInfo, VaultEntry>> function

Future<Vault<V>> newGenericVault<V, T extends Store<VaultInfo, VaultEntry>>(
  1. T store, {
  2. String? name,
  3. dynamic fromEncodable(
    1. Map<String, dynamic>
    )?,
  4. VaultLoader<V>? vaultLoader,
  5. Clock? clock,
  6. EventListenerMode? eventListenerMode,
  7. bool? statsEnabled,
  8. VaultStats? stats,
})

Creates a Vault bound to an implementation of the Store interface

  • store: The store implementation
  • name: The name of the vault
  • fromEncodable: The function that converts between the Map representation of the object and the object itself.
  • vaultLoader: The VaultLoader, that should be used to fetch a new value upon absence
  • clock: The source of time to be used
  • eventListenerMode: The event listener mode of this vault
  • statsEnabled: If statistics should be collected, defaults to false
  • stats: The statistics instance

Implementation

Future<Vault<V>> newGenericVault<V, T extends Store<VaultInfo, VaultEntry>>(
    T store,
    {String? name,
    dynamic Function(Map<String, dynamic>)? fromEncodable,
    VaultLoader<V>? vaultLoader,
    Clock? clock,
    EventListenerMode? eventListenerMode,
    bool? statsEnabled,
    VaultStats? stats}) {
  return DefaultVaultManager().newGenericVault(store,
      name: name,
      fromEncodable: fromEncodable,
      vaultLoader: vaultLoader,
      clock: clock,
      eventListenerMode: eventListenerMode,
      statsEnabled: statsEnabled,
      stats: stats);
}