Interface Chunk

Index

Methods

Methods

public end(data: string): Chunk

Writes data to this chunk's buffer and marks it as flushable. This method must be called on any chunks created via chunk.map. Do not call this method on a handler's main chunk -- dust.render and dust.stream take care of this for you.

Parameters

  • data: string

Returns

Chunk

public map(callback: (chunk: "dustjs-linkedin".Chunk) => any): Chunk

Creates a new chunk and passes it to callback. Use map to wrap asynchronous functions and to partition the template for streaming.

Parameters

  • callback: (chunk: "dustjs-linkedin".Chunk) => any

Returns

Chunk

public render(body: any, context: Context): Chunk

Renders a template block, such as a default block or an else block.

Parameters

Returns

Chunk

public setError(err: any): Chunk

Sets an error on this chunk and immediately flushes the output.

Parameters

  • err: any

Returns

Chunk

public tap(callback: (value: any) => any): Chunk

Convenience method to apply filters to a stream.

Parameters

  • callback: (value: any) => any

Returns

Chunk

public untap(): Chunk

Removes the head tap function from the list.

Returns

Chunk

public write(data: string): Chunk

Writes data to this chunk's buffer.

Parameters

  • data: string

Returns

Chunk