signalContainer<T, Arg> function

SignalContainer<T, Arg, Signal<T>> signalContainer<T, Arg>(
  1. Signal<T> create(
    1. Arg
    ), {
  2. bool cache = false,
})

Create a signal container used to instance signals based on args

final container = signalContainer<Cache, String>((e) {
  return signal(Cache(e));
});

final cacheA = container('cache-a');
final cacheB = container('cache-b');
final cacheC = container('cache-c');

cacheA.value = 'a';
cacheB.value = 'b';
cacheC.value = 'c';

Implementation

SignalContainer<T, Arg, Signal<T>> signalContainer<T, Arg>(
  Signal<T> Function(Arg) create, {
  bool cache = false,
}) {
  return SignalContainer<T, Arg, Signal<T>>(
    create,
    cache: cache,
  );
}