Crate hooks

source ·

Re-exports

pub use hooks_core as core;

Structs

Enums

Constants

Traits

Hooks that takes no args.
How to impl Hook
This is a helper trait to define lifetime generic associated types (lifetime-GAT) for Hook.
Common behaviors of types that share a value with inner mutability.

Functions

Please see get_new_dep_and_effect for how this works.
An identity method for defining get_new_dep_and_effect closure with proper lifetime generics.
Use another hook by just poll_next_update without calling use_hook. This allows conditionally using hooks. See also use_lazy_pinned_hook.
Register an effect for a dependency. The effect will be run in the poll_next_update after use_hook registers a new dependency.
Register an effect which will be run on next poll.
Use another hook lazily so you can use hooks conditionally.
use_state_n with a lazy initializer.
use_state with a lazy initializer.

Type Definitions

Attribute Macros