1import consumer from 'channels/consumer'; 2 3let marketChannelSubscription = null; 4 5function setupMarketChannel() { 6 if (marketChannelSubscription) return; 7 8 marketChannelSubscription = consumer.subscriptions.create( 9 { channel: 'MarketChannel' }, 10 { 11 connected() { 12 console.log('Connected to MarketChannel'); 13 }, 14 15 disconnected() { 16 console.log('Disconnected from MarketChannel'); 17 }, 18 19 received(data) { 20 if (data.type === 'pricing_update') { 21 window.dispatchEvent(new CustomEvent('market-prices-updated', { detail: data })); 22 } else if (data.type === 'market_state_change') { 23 window.dispatchEvent(new CustomEvent('market-state-changed', { detail: data })); 24 } 25 } 26 } 27 ); 28} 29 30setupMarketChannel();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.