getOrCreateRegister<T> method

SubscriptionCallback<T> getOrCreateRegister<T>(
  1. RelayCallbackRegister<T> register,
  2. String relay
)

Implementation

SubscriptionCallback<T> getOrCreateRegister<T>(
  RelayCallbackRegister<T> register,
  String relay,
) {
  final relayRegister = register[relay];

  if (relayRegister == null) {
    register[relay] = <String, void Function(String relay, T callback)>{};
  }

  return register[relay]!;
}