use-geul-pipe#

use-geul-pipe is hook for run typing effect with multiple values in order.

function useGeulPipe(
values: string[],
options: UseGeulPipeOptions,
): UseGeulPipeReturn;

values#

Values that will be sequential results of the typing effect.

UseGeulPipeOptions#

optiontypedescription
speednumberSpeed of typing effect (ms)
decomposeOnBackspaceboolean | undefined

Whether to have the effect of separating consonants when backspace

UseGeulPipeReturn#

membertypedescription
geulstringTyped value
isRunningbooleanRunning status of the geul instance
next() => voidfuntion that start next typing effect
reset() => voidfuntion that reset typing effect

Examples#

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

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: