mirror of
https://github.com/logos-messaging/waku-react.git
synced 2026-01-03 22:53:06 +00:00
add jsdocs
This commit is contained in:
parent
7314264dab
commit
599ac5cbe4
@ -21,6 +21,14 @@ type UseFilterMessagesResult = HookState & {
|
||||
messages: IDecodedMessage[];
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns messages from Filter subscription and keeps them up to date
|
||||
* @example
|
||||
* const { isLoading, error, message } = useFilterMessages({node, decoder});
|
||||
* @param {Object} node - node that implements Filter, hook does nothing if undefined
|
||||
* @param {Object} decoder - decoder to use for subscribing, hook does nothing if undefined
|
||||
* @returns {Object} hook state (isLoading, error) and messages array
|
||||
*/
|
||||
export const useFilterMessages = (
|
||||
params: UseFilterMessagesParams,
|
||||
): UseFilterMessagesResult => {
|
||||
|
||||
@ -23,6 +23,15 @@ type UseStoreMessagesResult = HookState & {
|
||||
messages: IDecodedMessage[];
|
||||
};
|
||||
|
||||
/**
|
||||
* Hook for retrieving messages from Store protocol based on options
|
||||
* @example
|
||||
* const { isLoading, error, messages } = useStoreMessages({node, decoder, options});
|
||||
* @param {Object} node - node that implement Store, hook does nothing if undefined
|
||||
* @param {Object} decoder - decoder to use for getting messages, hook does nothing if undefined
|
||||
* @param {StoreQueryOptions} options - options to initiate query to get messages
|
||||
* @returns {Object} hook state (isLoading, error) and messages array
|
||||
*/
|
||||
export const useStoreMessages = (
|
||||
params: UseStoreMessagesParams,
|
||||
): UseStoreMessagesResult => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user