useGetState

fun <T> useGetState(default: T & Any): Triple<T, SetValueFn<T & Any>, GetValueFn<T>>

Description: Using destructuring declarations on useState can cause closure problems. Using useLatestRef is a solution, but if you call the set function quickly(millisecond level), there will be a problem of state loss.

Now you can use useGetState to solve these problems and get the latest value through getter to avoid closure problems. The setter function also supports fast update.