ReactiveMapExtensions<K, V> extension

Extension methods on Map to create reactive maps.

These extensions allow regular Dart maps to be converted into reactive maps that automatically track changes and emit notifications when the map is modified.

Example usage:

// Create a reactive map
final userPrefs = {'theme': 'dark', 'fontSize': 14}.reactive;

// Listen for changes
userPrefs.stream.listen((snapshot) {
  print('Preferences changed!');
  print('Old: ${snapshot.oldValue}');
  print('New: ${snapshot.newValue}');
});

// Modify the map (triggers notification)
userPrefs.value['fontSize'] = 16;
userPrefs.value = Map.from(userPrefs.value); // Trigger notification
on

Properties

reactive Reactive<Map<K, V>>

Available on Map<K, V>, provided by the ReactiveMapExtensions extension

Creates a reactive map from this map.
no setter

Methods

toReactive({List<FluxivityMiddleware<Map<K, V>>>? middlewares}) Reactive<Map<K, V>>

Available on Map<K, V>, provided by the ReactiveMapExtensions extension

Creates a reactive map with custom middleware from this map.