UNPKG

use-stomp

Version:

react provider, class decorator, and a hook for websockets using the stomp protocol

31 lines (30 loc) 1.05 kB
import type { SnackbarProviderProps } from 'notistack'; import React from 'react'; export declare type UseStompNotificationsProviderProps = SnackbarProviderProps & { /** * url to connect to stomp protocol */ url: string; /** * request auth header will be passed to the server or agent through the STOMP connection frame */ authHeader?: string; /** * request header will be passed to the server or agent through the STOMP connection frame */ headers?: Record<string, unknown>; /** * interval(ms) of attempts to reconnect when the websocket connection is dropped; default is 10,000ms */ reconnectInterval?: number; /** * max number of attempts to reconnect when websocket connection is dropped; default is 10 */ reconnectMaxAttempts?: number; /** * enable testing of reconnection */ testReconnect?: boolean; }; declare const UseStompNotificationsProvider: React.FC<UseStompNotificationsProviderProps>; export default UseStompNotificationsProvider;