Sections

@calvinbonner/minifw API Reference

Version 0.2.1

core/partial

interface MiniPartial

interface MiniPartial {
  cache?: MiniCacheOptions;
  render(context: MiniContext): MaybePromise<string>;
  style(): MaybePromise<string>;
}

Represents a partial that can be rendered and served with server context. Partials are smaller reusable fragments that have access to request context, unlike MiniFragment which is context-free.

property cache

MiniCacheOptions

method render

render(context: MiniContext): MaybePromise<string>

method style

style(): MaybePromise<string>

function partial

partial(render: PartialRenderFunction, options?: PartialOptions): MiniPartial

Create a new MiniPartial instance.

render

The render function for the partial.

options

Optional configuration for the partial.

Returns:

A new MiniPartial instance.

partial(render: PartialRenderFunction, style: PartialStyleFunction, options?: PartialOptions): MiniPartial

Create a new MiniPartial instance.

render

The render function for the partial.

options

Optional configuration for the partial.

Returns:

A new MiniPartial instance.