register method

void register(
  1. String function,
  2. FutureOr<Object?> handler(
    1. Object?
    )
)

Register or override the handler for function (engine-unaware closure).

Safe to call before or after engine construction. Pre-construction calls take precedence over built-in defaults; init will not overwrite them.

Implementation

void register(String function, FutureOr<Object?> Function(Object?) handler) {
  _tombstones.remove(function);
  _composedDispatch.remove(function);
  _dispatch[function] = handler;
}