The selected state from the actor store. The nature of the returned state depends on the selector function provided.
// Assuming a 'LedgerActor' has been setup and used to manage the actor store
const name = useActorStore(state => state.name);
return <div>Canister Name: {name}</div>;
Provides a hook for accessing the state of an actor from the actor's store. This hook is part of a set of utilities that facilitate interactions with Internet Computer (IC) canisters by abstracting the complexities associated with actor management and state retrieval.
The
useActorStore
hook allows components to subscribe to and retrieve state from the actor store in a reactive way. This enables components to re-render when specific parts of the actor state change, which is managed by a selector function.