eo-typewriterjs / withCursor
Function: withCursor()
ts
function withCursor(state, cursorId): TTypewriterState;Defined in: core/state/helpers/typewriter-state.helper.ts:98
Parameters
| Parameter | Type | Description |
|---|---|---|
state | TTypewriterState | The current typewriter state |
cursorId | string | The cursor id to ensure exists |
Returns
A new TTypewriterState (or the same one if cursor already exists)
Description
Ensure a cursor exists in state, creating it at index 0 if absent.