- Support
reconnectAutomatically
option inSarus
initialization - Pass eventListeners into
Sarus
at initialization - Find a way to test the onopen event in the tests
- Make sure that the right event listeners are provided at initialization
- Add an event listener after initialization
- Prevent the same function being added multiple times to an event listener
- Remove an event listener function by passing the function
- Remove an event listener function by passing the name
- Throw an error when removing an event listener does not find it
- Support
doNotThrowError: true
when removing an event listener - Test sending a WebSocket message
- Make sure that adding/removing event listeners after initialization is bound on WebSocket as well
- Implement message queue with in-memory as default
- Make sure test assertion guarantees order of messages being extracted from queue
- Make retryProcessTimePeriod configurable
- Implement message queue with session storage as an option
- Implement message queue with local storage as an option
- Make the storageKey configurable
- Test loading messages stored in sessionStorage
- Test loading messages stored in localStorage
- Implement a way to configure WebSocket client options
- Implement a way to retrieve messages from a server, based on a key indicator
- Work out what to do when the message storage limit is reached (technically the browser will throw a QUOTA_EXCEEDED_ERR)
- Work out how to support sending binary data instead of string data
- Think about how to support higher-level use cases of WebSockets (rpc, pubsub) via a plugin architecture.
- TypeScript definitions