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
#option | type | description |
---|---|---|
speed | number | Speed of typing effect (ms) |
initial | string | undefined | Initial value that displayed before typing |
decomposeOnBackspace | boolean | undefined | Whether to have the effect of separating consonants when backspace |
UseGeulReturn
#member | type | description |
---|---|---|
geul | string | Typed value |
isRunning | boolean | Running status of the geul instance |
run | (onTypeEnd?: (() => void)) => void | funtion that start typing effect |
reset | () => void | funtion that reset typing effect |
""
-> "안녕하세요"
#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: 안녕하세요