2.2.6 • Published 9 years ago

signalr-amd v2.2.6

Weekly downloads
1
License
ISC
Repository
-
Last release
9 years ago

This version currently corresponds with SignalR 2.2.0

This is an unofficial node module for the SignalR javascript client that is wrapped in an AMD definition.

The major and minor version number are identical to the official SignalR package major and minor version number. The build number of this package will increase with code / documentation updates for this package specifically.

Usage

This module returns an object literal containing $.connection and $.hubConnection as its properties.

var signalr = require('signalr-amd');

// identical to $.connection, for people who use the generated proxies
var connection = signalr.connection;
// identical to $.hubConnection, for people who don't use the generated proxies
var hubConnection = signalr.hubConnection;
...

However, even just loading the file will decorate jQuery with the usual properties. So this is equally valid (as long as jQuery is a singleton):

require('signalr-amd');
var $ = require('jquery');
var connection = $.connection;
var hubConnection = $.hubConnection;
...

See The SignalR Javascript guide for more information.

Implementation

This is what the additional code looks like:

if ( typeof define === "function" && define.amd ) {
  define("signalr", ["jquery"], function (jQuery) {
    return factory(jQuery);
  });
} else {
  factory(window.jQuery || window.$);
}

where factory is a function around the original SignalR code.

This makes it compatible with AMD compatible libraries such as RequireJS, Webpack, ...

2.2.6

9 years ago

2.2.5

9 years ago

2.2.4

9 years ago

2.2.3

9 years ago

2.2.2

9 years ago

2.2.1

9 years ago

2.2.0

9 years ago