typeToFactory function

  1. @experimental
ComponentFactory<Object> typeToFactory(
  1. Object typeOrFactory
)

Transitional API: Returns a ComponentFactory for typeOrFactory.

If typeOrFactory is already a ComponentFactory this does nothing.

This API is slated for removal once the transition to factories is done.

Implementation

@experimental
ComponentFactory<Object> typeToFactory(Object typeOrFactory) =>
    typeOrFactory is ComponentFactory<Object>
        ? typeOrFactory
        : unsafeCast(reflector.getComponent(unsafeCast(typeOrFactory)));