ReactiveSetExtensions<E> extension

Extension methods on Set to create reactive sets.

These extensions allow regular Dart sets to be converted into reactive sets that automatically track changes and emit notifications when the set is modified. Sets are particularly useful for collections where each element should be unique.

Example usage:

// Create a reactive set
final activeUsers = {'user1', 'user2', 'admin'}.reactive;

// Listen for changes
activeUsers.stream.listen((snapshot) {
  final added = snapshot.newValue.difference(snapshot.oldValue);
  final removed = snapshot.oldValue.difference(snapshot.newValue);
  print('Added: $added, Removed: $removed');
});

// Modify the set (triggers notification)
activeUsers.value.add('user3');
activeUsers.value = Set.from(activeUsers.value); // Trigger notification
on

Properties

reactive Reactive<Set<E>>

Available on Set<E>, provided by the ReactiveSetExtensions extension

Creates a reactive set from this set.
no setter

Methods

toReactive({List<FluxivityMiddleware<Set<E>>>? middlewares}) Reactive<Set<E>>

Available on Set<E>, provided by the ReactiveSetExtensions extension

Creates a reactive set with custom middleware from this set.