Skip to content

eo-typewriterjs


eo-typewriterjs / withCursor

Function: withCursor()

ts
function withCursor(state, cursorId): TTypewriterState;

Defined in: core/state/helpers/typewriter-state.helper.ts:98

Parameters

ParameterTypeDescription
stateTTypewriterStateThe current typewriter state
cursorIdstringThe cursor id to ensure exists

Returns

TTypewriterState

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.

Released under the MIT License.