use-geul#

use-geul is basic hook for run typing effect.

function useGeul(value: string, options: UseGeulOptions): UseGeulReturn;

value#

Value that will be result of typing effect.

UseGeulOptions#

optiontypedescription
speednumberSpeed of typing effect (ms)
initialstring | undefinedInitial value that displayed before typing
decomposeOnBackspaceboolean | undefined

Whether to have the effect of separating consonants when backspace

UseGeulReturn#

membertypedescription
geulstringTyped value
isRunningbooleanRunning status of the geul instance
run(onTypeEnd?: (() => void)) => void

funtion that start typing effect

reset() => void

funtion that reset typing effect

Examples#

"" -> "안녕하세요"#

value: "안녕하세요"

options:

- speed: 50

- initial: ""

- decomposeOnBackspace:undefined

result:

"안녕" -> "안녕하세요"#

value: "안녕하세요"

options:

- speed: 50

- initial: "안녕"

- decomposeOnBackspace:undefined

result: 안녕

"안녕하세요" -> "" (without decomposeOnBackspace)#

value: ""

options:

- speed: 50

- initial: "안녕하세요"

- decomposeOnBackspace:undefined

result: 안녕하세요

"안녕하세요" -> "" (with decomposeOnBackspace)#

value: ""

options:

- speed: 50

- initial: "안녕하세요"

- decomposeOnBackspace:true

result: 안녕하세요