utopia_hooks 0.3.2+5 copy "utopia_hooks: ^0.3.2+5" to clipboard
utopia_hooks: ^0.3.2+5 copied to clipboard

Utopia USS libs - basic and complex hooks (including SubmitState, ComputedState and supporting widgets)

utopia_hooks #

Basic and complex hooks (including SubmitState, ComputedState and supporting widgets).

Highlights #

ComputedState #

Designed for cases where global/local state is asynchronously fetched, possibly based on some input data. Provides error handling, cancellation, previous value memoization, deduplication, manual updates and more. Also, via its useAutoComputedState variant, supports automatic re-fetching (keys), debouncing (debounceDuration) and conditional computation (shouldCompute).

ComputedWrapper widget family

Convenience widgets for consuming ComputedStates in UI. Has variants for refreshable and non-refreshable states with simple or list-based values

SubmitState #

Designed for cases where user action triggers some asynchronous operation. Supports two usage modes: first, bare-bones and flexible (submitState.run(operation)) and second, opinionated and convenient (submitState.runSimple(...)). Supports parallel submits, error handling, retrying and more.

HookStateProviderWidget #

Combination of HookWidget and Provider, designed for hook-based global states. Can be used with MultiProvider.

useSimpleEffect #

Similar to useEffect, but executes outside the build phase, which fixes common setState-during-build bugs.

useValueWrapper #

Simple hook that helps combat memoization issues. Basically a useRef which updates its value on every rebuild. Use in hooks that take functional arguments.
See useAppLifecycleStateCallbacks for an example.

6
likes
0
pub points
68%
popularity

Publisher

verified publisherutopiasoft.io

Utopia USS libs - basic and complex hooks (including SubmitState, ComputedState and supporting widgets)

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

async, equatable, fast_immutable_collections, flutter, flutter_hooks, provider, utopia_utils

More

Packages that depend on utopia_hooks