- useCanMessage(onError?): {
canMessage: (<T>(peerAddress: T) => Promise<CanMessageReturns<T>>);
canMessageStatic: (<T>(peerAddress: T, options?: Partial<NetworkOptions>) => Promise<CanMessageReturns<T>>);
error: null | Error;
isLoading: boolean;
} Parameters
Optional
onError: ((error: Error) => void)- (error): void
Returns void
Returns {
canMessage: (<T>(peerAddress: T) => Promise<CanMessageReturns<T>>);
canMessageStatic: (<T>(peerAddress: T, options?: Partial<NetworkOptions>) => Promise<CanMessageReturns<T>>);
error: null | Error;
isLoading: boolean;
}
canMessage: (<T>(peerAddress: T) => Promise<CanMessageReturns<T>>)
- <T>(peerAddress): Promise<CanMessageReturns<T>>
Type Parameters
- T extends string | string[]
Returns Promise<CanMessageReturns<T>>
canMessageStatic: (<T>(peerAddress: T, options?: Partial<NetworkOptions>) => Promise<CanMessageReturns<T>>)
- <T>(peerAddress, options?): Promise<CanMessageReturns<T>>
Type Parameters
- T extends string | string[]
Parameters
- peerAddress: T
Optional
options: Partial<NetworkOptions>
Returns Promise<CanMessageReturns<T>>
error: null | Error
isLoading: boolean
This hook exposes both the client and static instances of the
canMessage
method.