createActorMethodHooks
createActorMethodHooks<
Service,Transform>(reactor):object
Defined in: react/src/hooks/useActorMethod.ts:487
Creates a bound useMethod hook for a specific reactor instance.
Type Parameters
Section titled “Type Parameters”Service
Section titled “Service”Service = BaseActor
Transform
Section titled “Transform”Transform extends keyof TransformArgsRegistry<unknown> = "candid"
Parameters
Section titled “Parameters”reactor
Section titled “reactor”Reactor<Service, Transform>
Returns
Section titled “Returns”useMethod
Section titled “useMethod”useMethod: <
Method>(config) =>UseReactorMethodResult<Service,Method,Transform>
Hook for calling methods on the bound reactor.
Type Parameters
Section titled “Type Parameters”Method
Section titled “Method”Method extends string
Parameters
Section titled “Parameters”config
Section titled “config”Omit<UseReactorMethodParameters<Service, Method, Transform>, "reactor">
Returns
Section titled “Returns”UseReactorMethodResult<Service, Method, Transform>
Example
Section titled “Example”const { useMethod } = createActorMethodHooks(reactor)