Skip to main content

genPulse

@akhaled01/void • Docs


@akhaled01/void / pulse / genPulse

Function: genPulse()

genPulse<T>(initialValue, id, baseTemplate?, childTemplate?): Pulse<T>

Generate a new pulse and add it to the global registry.

Type Parameters​

• T extends object | any[]

Parameters​

• initialValue: T

The initial value of the pulse.

• id: string

The unique ID of the pulse.

• baseTemplate?

The base template for rendering the parent object.

• childTemplate?

A template specifically for child items, if applicable.

Returns​

Pulse<T>

Example​

const todos = genPulse([], "todos", todoListTemplate, () => <div>Child</div>);

Defined in​

pulse.ts:323