HiStore<K, V> class abstract

Abstract storage interface for hihook.

Storage adapters (Hive, SQLite, SharedPrefs, etc.) implement this interface to provide persistent storage capabilities to hihook-based applications.

The store is "pure" - it only handles storage operations. Event emission and hook execution are handled by the calling facade layer.

Example implementation:

class HiveStore implements HiStore<String, dynamic> {
  final Box<String> box;

  @override
  Future<dynamic> get(String key) async {
    final raw = await box.get(key);
    return raw != null ? jsonDecode(raw) : null;
  }
  // ... other methods
}

Constructors

HiStore()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
supportsMeta bool
Whether this store supports metadata.
no setter

Methods

clear() Future<void>
Clears all values from the store.
clearMeta() Future<void>
Clears all metadata from the store.
delete(K key) Future<void>
Deletes a value by key.
deleteMeta(K key) Future<void>
Deletes metadata for a key.
entries() Stream<MapEntry<K, V>>
Returns a stream of all key-value entries in the store.
get(K key) Future<V?>
Retrieves a value by key.
getMeta(K key) Future<Map<String, dynamic>?>
Retrieves metadata for a key.
keys() Stream<K>
Returns a stream of all keys in the store.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
put(K key, V value) Future<void>
Stores a value with the given key.
putMeta(K key, Map<String, dynamic> meta) Future<void>
Stores metadata for a key.
toString() String
A string representation of this object.
inherited
values() Stream<V>
Returns a stream of all values in the store.

Operators

operator ==(Object other) bool
The equality operator.
inherited