rad_hooks library

A set of commonly used Hooks for using in your Rad applications.

Classes

UseRefHook<T>
A hook for creating stateless value.
UseStateHook<T>
A hook for creating stateful value.

Functions

useCallback<T, V>(T callback(), [List<V>? dependencies]) → T Function()
Returns a memoized callback.
useEffect<T>(NullableVoidCallback callback, [List<T>? dependencies]) → void
Accepts a function that contains imperative, possibly effect-full code.
useLayoutEffect<T>(NullableVoidCallback callback, [List<T>? dependencies]) → void
The signature is identical to useEffect, but it fires before DOM updates are flushed to the DOM. At this point, DOM is still in previous state (possibly stale).
useMemo<T, V>(T create(), [List<V>? dependencies]) → T
Returns a memoized value.
useRef<T>(T initialValue) UseRefHook<T>
useRef returns a mutable ref object whose .value property is initialized to the passed argument initialValue.
useState<T>(T initialState) UseStateHook<T>
Returns a state object whose .value property is initialized to the passed argument initialState.