@vasilvelikov/effective-ui
    Preparing search index...

    Function withData

    • Wraps an async data loader and renderer into a single effectful component function.

      Type Parameters

      • I

        The input type.

      • O

        The output type.

      • E = never

        The error type.

      Parameters

      • load: (input: I) => Effect<O, E>

        A function that loads the data asynchronously.

      • render: (data: O) => Effect<Node, never, EventRegistry>

        A function that renders a DOM node from the loaded data.

      Returns (input: I) => Effect<Node, E>

      A function that takes input and returns a DOM-producing Effect.