Skip to content

Function: createRenderErrorBinding()

API / @xmachines/play-view / index / createRenderErrorBinding

function createRenderErrorBinding<TResult>(): (result, handler, onRootFailure?) => TResult;

Defined in: packages/play-view/src/provider-guards.ts:160

Makes a binding of an onRenderError handler to a registry result, for one provider.

A provider calls the binding on each render with the registry result, the handler of that render, and the containment of a failure of the root. The binding returns:

  • the registry result itself, when it receives neither a handler nor a containment;
  • else one copy for each registry. The copy gives each report to forwardRenderError, with the LATEST handler, and it gives a failure of the root to the LATEST containment. A host that passes a new inline function on each render therefore keeps one registry identity, and the renderer below resolves no element again for it.

The copy comes from attachRenderErrorHandler, so it keeps the slot metadata.

Type Parameters

Type ParameterDescription
TResult extends objectThe result type of defineRegistry of the framework.

Returns

The binding of one provider.

(result, handler, onRootFailure?) => TResult