Skip to content

Create Write and WritePartial Functions for Output Helpers #3

@piraz

Description

@piraz

Add Write and WritePartial helper functions to the candango/uiok project. These functions should simplify writing the output of components or their partials directly to an io.Writer (such as http.ResponseWriter or bytes.Buffer), improving usability and integration with HTTP handlers.

Tasks

  • Implement a Write(w io.Writer, c Component) error function that writes the fully rendered output of a component to the provided writer.
  • Implement a WritePartial(w io.Writer, c Component) error function that writes only the partial output of a component to the writer.
  • Both functions should handle errors gracefully and ensure all output is written.
  • Add documentation and usage examples for both helpers.
  • Create basic tests to verify that output is correctly written for various types of components.

Acceptance Criteria

  • The codebase includes the new Write and WritePartial helper functions.
  • Functions work seamlessly with any io.Writer (including http.ResponseWriter).
  • Usage examples are present in code, docs, or examples directory.
  • Functions are covered by basic tests and error cases.
  • Code builds and all tests pass.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions