jQueryless SignalR
This is a signalR version, which does not depend on jquery (so it's "jqueryless"). It provides it's own shim to replace jquery and exports just the needed function from signalR.
API
The default export if this library equals the $.hubConnection function, which helps you to setup your hub. For details of the original API see here.
Example
Because the API description might not be that useful, I'll provide an example showing how to use this library correctly:
// first we import the libraryconst signalR = ;// then we define the connection options. You can use all options from the originalconst connectionOptions = useDefaultPath: false // whether to use the default path or not // transport: array of any allowed transports (options: webSockets, foreverFrame, serverSentEvents, longPolling) // and any other options I don't know...;// then we create the connection itselfconst connection = ; // here we define the query string for this connection. Usually you want to provide// any authentication hereconnectionqs = token: 'authenticationtoken' version: '1.0.0'; // then we create a hub proxy. We have to define one proxy per hub we want to useconst myHub = connection; // and register all callbacks on the hub. So here we tell the hub, that we can// receive "echo" messages from the backendmyHub;// ... define other listeners as well. To unregister them use myHub.off(event, listener) // then we start the connection. this returns a jquery deferred, which has *done/fail*// instead of *then/catch*.connectionstart ; // if we want to stop the connection, we can call connection.stop()
License
SignalR is licensed under Apache License Version 2.0. You can find a copy of the license in the SIGNALR-LICENSE file. The rest of the code written here is licensed under the terms of MIT (see LICENSE file).