signalr2 1.0.4 copy "signalr2: ^1.0.4" to clipboard
signalr2: ^1.0.4 copied to clipboard

A dart wrapper around the official SignalR JavaScript library for ASP.NET Core 2.1

signalr2 #

Incredibly simple real-time web for ASP.NET Core 2.1 This is an interop library for the @aspnet/signalr package. Find more Information at https://github.com/aspnet/SignalR

Currently in sync with the release 1.0.4 from 2018-10-17.

Usage #

Add a <script> tag to your index.html and point it to the current SignalR JavaScript file distributed with the current release of this library:

<script src="packages/signalr2/dist/signalr.min.js"></script>

A simple usage example:

import 'dart:async';
import 'dart:js';
import 'package:signalr2/signalr2.dart' as signalr;

Future<Null> main() async {
  var connection = new signalr.HubConnectionBuilder()
      .withUrl('/chat')
      .configureLogging(signalr.LogLevel.Information)
      .build();

  connection.on('send', allowInterop((data) {
    print(data);
  }));

  await connection.start();

  new Timer.periodic(const Duration(seconds: 1), (r) {
    connection.send('send', 'Hi');
  });
}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

1
likes
30
pub points
0%
popularity

Publisher

unverified uploader

A dart wrapper around the official SignalR JavaScript library for ASP.NET Core 2.1

Repository (GitHub)
View/report issues

License

BSD-3-Clause (LICENSE)

Dependencies

func2, js

More

Packages that depend on signalr2