mobility-toolbox-js
Version:
Toolbox for JavaScript applications in the domains of mobility and logistics.
12 lines (11 loc) • 722 B
TypeScript
import type { WebSocketAPIMessageCallback } from '../../api/WebSocketAPI';
/**
* This function returns a WebSocket api callback, and call the onUpdate function with the list of of subscribed objects changes.
*
* @param {function(objects: any[])} onUpdate callback when list of subscribed objects changes, called after 100 ms
* @param {function(object: any)} [getObjectId = true] function returning the id of an object
* @param {number} [timeout = 100] debounce timeout in ms
* @private
*/
declare const debounceWebsocketMessages: (onUpdate: (objects: unknown[]) => void, getObjectId?: (object: unknown) => string, timeout?: number) => WebSocketAPIMessageCallback<unknown>;
export default debounceWebsocketMessages;