watchSecretsAs<T> method

Stream<T> watchSecretsAs<T>(
  1. T fromMap(
    1. Map<String, String>
    ), {
  2. Duration interval = const Duration(minutes: 5),
  3. String? projectRef,
  4. String? environmentSlug,
})

Like watchSecrets but maps each emission through fromMap.

client.watchSecretsAs(AppSecrets.fromMap).listen((s) {
  setState(() => _secrets = s);
});

Implementation

Stream<T> watchSecretsAs<T>(
  T Function(Map<String, String>) fromMap, {
  Duration interval = const Duration(minutes: 5),
  String? projectRef,
  String? environmentSlug,
}) =>
    watchSecrets(
      interval: interval,
      projectRef: projectRef,
      environmentSlug: environmentSlug,
    ).map(fromMap);