castCallback1ForDirective<T, A> function

  1. @Deprecated('Use directiveTypes: [ ... ] to properly type instead')
T Function(dynamic) castCallback1ForDirective<T, A>(
  1. T callback(
    1. A
    )
)

Wraps an typed callback with a single parameter of type A.

This function returns an untyped callback with a single parameter of type dynamic, which in turn dynamically is casted/checked to A before invoking callback.

Implementation

@Deprecated('Use directiveTypes: [ ... ] to properly type instead')
T Function(dynamic) castCallback1ForDirective<T, A>(
  T Function(A) callback,
) {
  return (element) => callback(element as A);
}