putIfAbsentDescriptor<TAction extends Action<TParam, TResult>, TParam, TResult> method

ActionDescriptor<TAction, TParam, TResult> putIfAbsentDescriptor<TAction extends Action<TParam, TResult>, TParam, TResult>(
  1. String permanentKey,
  2. TAction factory()
)

Implementation

ActionDescriptor<TAction, TParam, TResult> putIfAbsentDescriptor<
    TAction extends Action<TParam, TResult>,
    TParam,
    TResult>(String permanentKey, TAction Function() factory) {
  if (permanentKey.isEmpty) {
    throw ArgumentError.value(permanentKey);
  }

  final descriptor = _actionDescriptors.putIfAbsent(
          permanentKey,
          () => ActionDescriptor<TAction, TParam, TResult>(
              _makePath(permanentKey), factory))
      as ActionDescriptor<TAction, TParam, TResult>;

  return descriptor;
}