UNPKG

cluedin-widget

Version:

This is the project for creating and managing widgets in CluedIn.

27 lines (20 loc) 745 B
import config from '../config' import { receiveCrawlerStats } from '../action/provider'; let connection = $.hubConnection( config.url.api + '/signalr', { useDefaultPath: false } ); connection.logging = true; connection.qs = { 'Bearer': config.token }; let proxy = connection.createHubProxy( 'clientHub' ); export function linkRealTimeWithStore( store ) { proxy.on( 'ProviderStats', function( messageName, crawlerInfo, typeId, integrationId ) { store.dispatch( receiveCrawlerStats( { crawlerInfo, typeId, integrationId } ) ); } ); proxy.connection.error( function() { console.log( 'error' ); console.log( arguments ); } ); //connection.start(); }